Package org.cip4.lib.xjdf.xml
Class XJdfParser<T>
java.lang.Object
org.cip4.lib.xjdf.xml.XJdfParser<T>
- Type Parameters:
T- The root node this parser applies to. Valid values are 'XJDF' and 'XJMF'
This class is a parser based on the XJDF Schema.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal TreadXml(byte[] bytes) Read an XML byte array and converts it to an object tree.final TreadXml(InputStream inputStream) Read an XML input stream and converts it to an object tree.final byte[]Write an XJDF object tree to a binary array.final voidwriteXml(T node, OutputStream outputStream) Write an XJDF object tree to a binary output stream.
-
Constructor Details
-
XJdfParser
public XJdfParser()Default constructor.
-
-
Method Details
-
readXml
Read an XML byte array and converts it to an object tree.- Parameters:
bytes- The XML byte array to be parsed.- Returns:
- The parsed object tree.
- Throws:
XJdfParseException
-
readXml
Read an XML input stream and converts it to an object tree.- Parameters:
inputStream- The XML input stream to be parsed.- Returns:
- The parsed object tree.
- Throws:
XJdfParseException
-
writeXml
Write an XJDF object tree to a binary array.- Parameters:
node- Object tree to be written.- Returns:
- The XJDF Document as xml byte array.
- Throws:
XJdfParseException
-
writeXml
Write an XJDF object tree to a binary output stream.- Parameters:
node- Object tree to be written.outputStream- The output stream the XML stream is written to.- Throws:
XJdfParseException
-