T - Object type that will be parsed.public abstract class AbstractXmlParser<T> extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractXmlParser(JAXBContext jaxbContext)
Custom constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract AbstractXmlValidator<T> |
createValidator()
Create validator for validating documents.
|
protected abstract com.sun.xml.bind.marshaller.NamespacePrefixMapper |
getNamespacePrefixMapper()
Returns a new specific NamespacePrefixMapper implementation.
|
protected abstract String |
getXmlHeader()
Returns the XML Header for marshaling.
|
protected Object |
parseNode(Node w3cNode)
Parse a W3C Node to a XML Node.
|
protected void |
parseNode(Object xmlNode,
Node w3cNode)
Parse an XML Node to a W3C Node.
|
T |
parseStream(InputStream is)
Parse a binary input stream to a object tree.
|
protected byte[] |
parseXml(T obj)
Parse the object tree of an document to a byte array.
|
protected byte[] |
parseXml(T obj,
boolean skipValidation)
Parse a object tree to a byte array.
|
protected void |
parseXml(T obj,
OutputStream os)
Parse the object tree of an document to a binary output stream.
|
protected void |
parseXml(T obj,
OutputStream os,
boolean skipValidation)
Parse a object tree to a binary output stream.
|
protected AbstractXmlParser(JAXBContext jaxbContext)
jaxbContext - Context for JAXB-Handling.protected final Object parseNode(Node w3cNode) throws JAXBException
w3cNode - The W3C Node to be parsed.JAXBExceptionprotected final void parseNode(Object xmlNode, Node w3cNode) throws JAXBException
xmlNode - The XML Node to be parsed.w3cNode - The W3C Result node.JAXBExceptionprotected final byte[] parseXml(T obj) throws ParserConfigurationException, JAXBException, SAXException, IOException
obj - Object tree for parsing.ParserConfigurationExceptionJAXBExceptionSAXExceptionIOExceptionprotected final void parseXml(T obj, OutputStream os) throws IOException, ParserConfigurationException, SAXException, JAXBException
obj - Object tree for parsing.os - OutputStream the write the document to.ValidationException - Is thrown in case document is not valid and validation process is not being skipped.IOExceptionParserConfigurationExceptionSAXExceptionJAXBExceptionprotected final byte[] parseXml(T obj, boolean skipValidation) throws IOException, ParserConfigurationException, SAXException, JAXBException
obj - Object tree for parsing.skipValidation - Skip validation.IOExceptionParserConfigurationExceptionSAXExceptionJAXBExceptionprotected final void parseXml(T obj, OutputStream os, boolean skipValidation) throws JAXBException, IOException, ParserConfigurationException, SAXException
obj - Object tree object for parsing.os - Target OutputStream where document is being parsed.skipValidation - Indicates whether or not validation has to be skipped.ValidationException - Is thrown in case the document is not valid and validation process is not being
skipped.JAXBExceptionIOExceptionParserConfigurationExceptionSAXExceptionpublic final T parseStream(InputStream is) throws JAXBException
is - Binary document input stream for parsing.JAXBExceptionprotected abstract com.sun.xml.bind.marshaller.NamespacePrefixMapper getNamespacePrefixMapper()
protected abstract String getXmlHeader()
protected abstract AbstractXmlValidator<T> createValidator()
Copyright © 2016. All rights reserved.