Package org.jcsp.net
Class XMLNodeFactory
java.lang.Object
org.jcsp.net.XMLNodeFactory
- All Implemented Interfaces:
Serializable
,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
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionXMLNodeFactory
(File xmlFile) Constructs anXMLNodeFactory
that uses the specified file.XMLNodeFactory
(String filename) Constructs anXMLNodeFactory
that uses the specified file.XMLNodeFactory
(URL xmlFile) Constructs anXMLNodeFactory
that uses the specified file. -
Method Summary
Modifier and TypeMethodDescriptioninitNode
(Node node, Node.Attributes attribs) This is called by theNode
class.
-
Field Details
-
config
-
-
Constructor Details
-
XMLNodeFactory
Constructs anXMLNodeFactory
that uses the specified file.- Parameters:
filename
- the file name of the config file to use.- Throws:
IOException
-
XMLNodeFactory
Constructs anXMLNodeFactory
that uses the specified file.- Parameters:
xmlFile
- aFile
object pointing to the XML file to use.- Throws:
IOException
-
XMLNodeFactory
Constructs anXMLNodeFactory
that uses the specified file.- Parameters:
xmlFile
- aURL
object pointing to the XML file to use.- Throws:
IOException
-
-
Method Details
-
initNode
This is called by theNode
class.- Specified by:
initNode
in interfaceNodeFactory
- Parameters:
node
- the Node object calling the method.attribs
- the attributes that need to be set by the method.- Throws:
NodeInitFailedException
- if initialization failed.
-