public class MDFHeaderFactory
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
MDFHeaderFactory.ReaderResult
The result of the reader process.
|
static class |
MDFHeaderFactory.StreamReader |
protected class |
MDFHeaderFactory.TimeOut
Class to timeout MDFReader process.
|
static class |
MDFHeaderFactory.VHandler
The validation handler to the XML reader.
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
filename |
Modifier | Constructor and Description |
---|---|
protected |
MDFHeaderFactory()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
static org.w3c.dom.Element |
getElementByName(org.w3c.dom.Element element,
java.lang.String name)
Get a named node element.
|
static org.w3c.dom.Element |
getElementByName(org.w3c.dom.Element element,
java.lang.String name,
java.lang.String attr)
Get a named node element.
|
MDFHeader |
getHeader(java.lang.String filename)
Get the MDFHeader object belongs to the given filename.
|
static MDFHeaderFactory |
getInstance()
Get an instance of the facgtory.
|
static void |
main(java.lang.String[] args)
The main testing method.
|
org.w3c.dom.Document |
parse(java.lang.String filename)
Get the DOM from MDF file header.
|
MDFHeader |
read(java.lang.String mdfFilename)
Get the DOM from MDF file header.
|
static java.lang.Object |
readXML(java.io.InputStream stream,
java.lang.String packageName,
java.lang.String schemaResource,
java.util.logging.Logger logger,
java.lang.String loggerPrefix)
Read from input stream.
|
static java.lang.Object |
readXML(java.lang.String resource,
java.lang.String packageName,
java.lang.String schemaResource,
java.util.logging.Logger logger)
Read an XML file.
|
void |
setXMLFilename(java.lang.String filename)
Set the filename to read the XML from.
|
public static MDFHeaderFactory getInstance()
public void setXMLFilename(java.lang.String filename)
filename
- the XML filename. If this filename is null the
XML stream will be generated by the MDFReader executable directly.public org.w3c.dom.Document parse(java.lang.String filename) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
filename
- The MDF header XML filejava.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public MDFHeader read(java.lang.String mdfFilename) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
filename
- The MDF filejava.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
javax.xml.bind.JAXBException
java.io.FileNotFoundException
public MDFHeader getHeader(java.lang.String filename) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
filename
- the MDF filenamejava.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
javax.xml.bind.JAXBException
java.io.FileNotFoundException
public static org.w3c.dom.Element getElementByName(org.w3c.dom.Element element, java.lang.String name)
public static org.w3c.dom.Element getElementByName(org.w3c.dom.Element element, java.lang.String name, java.lang.String attr)
public static java.lang.Object readXML(java.lang.String resource, java.lang.String packageName, java.lang.String schemaResource, java.util.logging.Logger logger) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
resource
- The name of the file or a resource.packageName
- The package name to be used for marshaling.schemaResource
- The resource of the schemalogger
- A logger to be used when schema validation problem exist.javax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public static java.lang.Object readXML(java.io.InputStream stream, java.lang.String packageName, java.lang.String schemaResource, java.util.logging.Logger logger, java.lang.String loggerPrefix) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
stream
- the input stream.packageName
- The package name to be used for marshaling.schemaResource
- The resource of the schemalogger
- A logger to be used when schema validation problem exist.javax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public static void main(java.lang.String[] args)
args
- the command line arguments. The first argument must be the name of the MDF file or
a XML file containing the output of the MDFReader.