Package org.cip4.lib.xjdf.xml
Class XJdfParser
Parsing logic for building a XML Document from XJDF DOM-Tree and the way around.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final AbstractXmlValidatorCreate validator for validating documents.protected final com.sun.xml.bind.marshaller.NamespacePrefixMapperReturns a new specific NamespacePrefixMapper implementation.protected final StringReturns the XML Header for marshaling.final byte[]Parse a XJDF Object Tree to a byte array.final byte[]Parse a XJDF Object Tree to a byte array.final voidparseXJdf(XJDF xJdf, OutputStream os) Parse a XJDF Object Tree to a binary output stream.final voidparseXJdf(XJDF xJdf, OutputStream os, boolean skipValidation) Parse a XJDF 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
-
Constructor Details
-
XJdfParser
public XJdfParser() throws javax.xml.bind.JAXBExceptionDefault constructor.- Throws:
javax.xml.bind.JAXBException- Thrown in case a JAXBException occurs.
-
-
Method Details
-
parseXJdf
Parse a XJDF Object Tree to a binary output stream.- Parameters:
xJdf- XJDF Object Tree for parsing.os- Target OutputStream where XJdfDocument is being parsed.- Throws:
javax.xml.bind.JAXBException- Is thrown in case any error while un-/marshalling occurs.
-
parseXJdf
public final void parseXJdf(XJDF xJdf, OutputStream os, boolean skipValidation) throws javax.xml.bind.JAXBException Parse a XJDF Object Tree to a binary output stream.- Parameters:
xJdf- XJDF Object Tree for parsing.os- Target OutputStream where XJdfDocument is being parsed.skipValidation- Skip validation.- Throws:
javax.xml.bind.JAXBException- Is thrown in case any error while un-/marshalling occurs.
-
parseXJdf
Parse a XJDF Object Tree to a byte array.- Parameters:
xJdf- XJDF Object Tree for parsing.- Returns:
- XJDF as byte array.
- Throws:
IOException- Is thrown in case any IO error occurs.javax.xml.bind.JAXBException- Is thrown in case any error while un-/marshalling occurs.
-
parseXJdf
public final byte[] parseXJdf(XJDF xJdf, boolean skipValidation) throws javax.xml.bind.JAXBException, IOException Parse a XJDF Object Tree to a byte array.- Parameters:
xJdf- XJDF Object Tree for parsing.skipValidation- Skip validation.- Returns:
- XJDF as byte array.
- Throws:
javax.xml.bind.JAXBException- Is thrown in case any error while un-/marshalling occurs.IOException- Is thrown in case any IO error occurs.
-
getNamespacePrefixMapper
protected final com.sun.xml.bind.marshaller.NamespacePrefixMapper getNamespacePrefixMapper()Description copied from class:AbstractXmlParserReturns a new specific NamespacePrefixMapper implementation.- Specified by:
getNamespacePrefixMapperin classAbstractXmlParser<XJDF>- Returns:
- New specific NamespacePrefixMapper implementation.
-
getXmlHeader
Description copied from class:AbstractXmlParserReturns the XML Header for marshaling.- Specified by:
getXmlHeaderin classAbstractXmlParser<XJDF>- Returns:
- XML Header as String
-
createValidator
Description copied from class:AbstractXmlParserCreate validator for validating documents.- Specified by:
createValidatorin classAbstractXmlParser<XJDF>- Returns:
- Validator
-