public class XMLNodeFactory extends java.lang.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(java.io.File xmlFile)
Constructs an
XMLNodeFactory that uses the
specified file. |
XMLNodeFactory(java.lang.String filename)
Constructs an
XMLNodeFactory that uses the
specified file. |
XMLNodeFactory(java.net.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(java.lang.String filename)
throws java.io.IOException
XMLNodeFactory that uses the
specified file.filename - the file name of the config file to use.java.io.IOExceptionpublic XMLNodeFactory(java.io.File xmlFile)
throws java.io.IOException
XMLNodeFactory that uses the
specified file.xmlFile - a File object pointing to the
XML file to use.java.io.IOExceptionpublic XMLNodeFactory(java.net.URL xmlFile)
throws java.io.IOException
XMLNodeFactory that uses the
specified file.xmlFile - a URL object pointing to the
XML file to use.java.io.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–2019. All rights reserved.