public class XMLNodeFactory extends Object implements NodeFactory
Factory for node instantiation based on an XML-like file.
The factory uses its own XML parser that supports a sub-set of XML. The current implementation will parse a file compatible with jcsp-config.dtd. The parser does not current test conformance to this DTD. It does not currently support XML comments.
An example of using this class can be seen in
.
CNS
| Constructor and Description |
|---|
XMLNodeFactory(File xmlFile)
Constructs an
XMLNodeFactory that uses the
specified file. |
XMLNodeFactory(String filename)
Constructs an
XMLNodeFactory that uses the
specified file. |
XMLNodeFactory(URL xmlFile)
Constructs an
XMLNodeFactory that uses the
specified file. |
| Modifier and Type | Method and Description |
|---|---|
NodeKey |
initNode(Node node,
Node.Attributes attribs)
This is called by the
Node class. |
public XMLNodeFactory(String filename) throws IOException
XMLNodeFactory that uses the
specified file.filename - the file name of the config file to use.IOExceptionpublic XMLNodeFactory(File xmlFile) throws IOException
XMLNodeFactory that uses the
specified file.xmlFile - a File object pointing to the
XML file to use.IOExceptionpublic XMLNodeFactory(URL xmlFile) throws IOException
XMLNodeFactory that uses the
specified file.xmlFile - a URL object pointing to the
XML file to use.IOExceptionpublic NodeKey initNode(Node node, Node.Attributes attribs) throws NodeInitFailedException
Node class.initNode in interface NodeFactorynode - the Node object calling the method.attribs - the attributes that need to be set by the method.NodeInitFailedException - if initialization failed.Copyright © 1996–2015. All rights reserved.