Class PrintTalkParser


  • public class PrintTalkParser
    extends org.cip4.lib.xjdf.xml.internal.AbstractXmlParser<PrintTalk>
    Parsing logic for building a XML Document from PrintTalk DOM-Tree and the way around.
    • Constructor Summary

      Constructors 
      Constructor Description
      PrintTalkParser()
      Private default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.cip4.lib.xjdf.xml.internal.AbstractXmlValidator createValidator()  
      protected com.sun.xml.bind.marshaller.NamespacePrefixMapper getNamespacePrefixMapper()
      Returns a new specific NamespacePrefixMapper implementation.
      protected java.lang.String getXmlHeader()
      Returns the XML Header for marshaling.
      byte[] parsePrintTalk​(PrintTalk printTalk)
      Parse a PrintTalk Object Tree to a byte array.
      byte[] parsePrintTalk​(PrintTalk printTalk, boolean skipValidation)
      Parse a PrintTalk Object Tree to a byte array.
      void parsePrintTalk​(PrintTalk printTalk, java.io.OutputStream os)
      Parse a PrintTalk Object Tree to a binary output stream.
      void parsePrintTalk​(PrintTalk printTalk, java.io.OutputStream os, boolean skipValidation)
      Parse a PrintTalk Object Tree to a binary output stream.
      • Methods inherited from class org.cip4.lib.xjdf.xml.internal.AbstractXmlParser

        parseNode, parseNode, parseStream, parseXml, parseXml, parseXml, parseXml
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PrintTalkParser

        public PrintTalkParser()
                        throws javax.xml.bind.JAXBException
        Private default constructor.
        Throws:
        javax.xml.bind.JAXBException - Thrown in case a JAXBException occurs.
    • Method Detail

      • parsePrintTalk

        public final void parsePrintTalk​(PrintTalk printTalk,
                                         java.io.OutputStream os)
                                  throws javax.xml.parsers.ParserConfigurationException,
                                         javax.xml.bind.JAXBException,
                                         org.xml.sax.SAXException,
                                         java.io.IOException
        Parse a PrintTalk Object Tree to a binary output stream.
        Parameters:
        printTalk - PrintTalk Object Tree for parsing.
        os - Target OutputStream where PrintTalk Document is being parsed.
        Throws:
        javax.xml.parsers.ParserConfigurationException - Is thrown in case a serious configuration error occurs.
        javax.xml.bind.JAXBException - Is thrown in case any error while un-/marshalling occurs.
        org.xml.sax.SAXException - Is thrown in case parsing an xml document fails.
        java.io.IOException - Is thrown in case any IO error occurs.
      • parsePrintTalk

        public final void parsePrintTalk​(PrintTalk printTalk,
                                         java.io.OutputStream os,
                                         boolean skipValidation)
                                  throws java.io.IOException,
                                         javax.xml.parsers.ParserConfigurationException,
                                         org.xml.sax.SAXException,
                                         javax.xml.bind.JAXBException
        Parse a PrintTalk Object Tree to a binary output stream.
        Parameters:
        printTalk - PrintTalk Object Tree for parsing.
        os - Target OutputStream where PrintTalk Document is being parsed.
        skipValidation - Indicates whether or not validation has to be skipped.
        Throws:
        javax.xml.parsers.ParserConfigurationException - Is thrown in case a serious configuration error occurs.
        javax.xml.bind.JAXBException - Is thrown in case any error while un-/marshalling occurs.
        org.xml.sax.SAXException - Is thrown in case parsing an xml document fails.
        java.io.IOException - Is thrown in case any IO error occurs.
      • parsePrintTalk

        public final byte[] parsePrintTalk​(PrintTalk printTalk)
                                    throws javax.xml.parsers.ParserConfigurationException,
                                           java.io.IOException,
                                           org.xml.sax.SAXException,
                                           javax.xml.bind.JAXBException
        Parse a PrintTalk Object Tree to a byte array.
        Parameters:
        printTalk - PrintTalk Object Tree for parsing.
        Returns:
        PrintTalk as byte array.
        Throws:
        javax.xml.parsers.ParserConfigurationException - Is thrown in case a serious configuration error occurs.
        javax.xml.bind.JAXBException - Is thrown in case any error while un-/marshalling occurs.
        org.xml.sax.SAXException - Is thrown in case parsing an xml document fails.
        java.io.IOException - Is thrown in case any IO error occurs.
      • parsePrintTalk

        public final byte[] parsePrintTalk​(PrintTalk printTalk,
                                           boolean skipValidation)
                                    throws javax.xml.parsers.ParserConfigurationException,
                                           javax.xml.bind.JAXBException,
                                           org.xml.sax.SAXException,
                                           java.io.IOException
        Parse a PrintTalk Object Tree to a byte array.
        Parameters:
        printTalk - PrintTalk Object Tree for parsing.
        skipValidation - Skip validation.
        Returns:
        PrintTalk as byte array.
        Throws:
        javax.xml.parsers.ParserConfigurationException - Is thrown in case a serious configuration error occurs.
        javax.xml.bind.JAXBException - Is thrown in case any error while un-/marshalling occurs.
        org.xml.sax.SAXException - Is thrown in case parsing an xml document fails.
        java.io.IOException - Is thrown in case any IO error occurs.
      • getNamespacePrefixMapper

        protected final com.sun.xml.bind.marshaller.NamespacePrefixMapper getNamespacePrefixMapper()
        Returns a new specific NamespacePrefixMapper implementation.
        Specified by:
        getNamespacePrefixMapper in class org.cip4.lib.xjdf.xml.internal.AbstractXmlParser<PrintTalk>
        Returns:
        New specific NamespacePrefixMapper implementation.
      • getXmlHeader

        protected final java.lang.String getXmlHeader()
        Returns the XML Header for marshaling.
        Specified by:
        getXmlHeader in class org.cip4.lib.xjdf.xml.internal.AbstractXmlParser<PrintTalk>
        Returns:
        XML Header as String
      • createValidator

        protected final org.cip4.lib.xjdf.xml.internal.AbstractXmlValidator createValidator()
        Specified by:
        createValidator in class org.cip4.lib.xjdf.xml.internal.AbstractXmlParser<PrintTalk>