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 Object
This class is a parser based on the XJDF Schema.
  • Constructor Details

    • XJdfParser

      public XJdfParser()
      Default constructor.
  • Method Details

    • 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(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, 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