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'
public class XJdfParser<T> extends java.lang.ObjectThis class is a parser based on the XJDF Schema.
-
-
Constructor Summary
Constructors Constructor Description XJdfParser()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TreadXml(byte[] bytes)Read an XML byte array and converts it to an object tree.TreadXml(java.io.InputStream inputStream)Read an XML input stream and converts it to an object tree.byte[]writeXml(T node)Write an XJDF object tree to a binary array.voidwriteXml(T node, java.io.OutputStream outputStream)Write an XJDF object tree to a binary output stream.
-
-
-
Constructor Detail
-
XJdfParser
public XJdfParser() throws XJdfInitExceptionDefault constructor.- Throws:
XJdfInitException
-
-
Method Detail
-
readXml
public final T readXml(byte[] bytes) throws XJdfParseException
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
public final T readXml(java.io.InputStream inputStream) throws XJdfParseException
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
public final byte[] writeXml(T node) throws XJdfParseException
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
public final void writeXml(T node, java.io.OutputStream outputStream) throws XJdfParseException
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
-
-