Package com.helger.jaxb
Interface IJAXBReader<JAXBTYPE>
- Type Parameters:
JAXBTYPE- The JAXB type to be read
- All Known Implementing Classes:
GenericJAXBMarshaller,JAXBReaderBuilder
public interface IJAXBReader<JAXBTYPE>
Interface for reading JAXB documents from various sources.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionbooleandefault JAXBTYPEread(byte[] aXML) Read a document from the specified byte array.default JAXBTYPEread(byte[] aXML, int nOfs, int nLen) Read a document from the specified byte array.default JAXBTYPEread(char[] aXML) Read a document from the specified char array.default JAXBTYPEread(com.helger.commons.io.IHasInputStream aISP) Read a document from the specified input stream provider.default JAXBTYPEread(com.helger.commons.io.resource.IReadableResource aResource) Read a document from the specified resource.read(IJAXBUnmarshaller<JAXBTYPE> aHandler) Read a document using the passed handler.default JAXBTYPEread(com.helger.xml.serialize.read.SAXReaderSettings aSettings, InputSource aInputSource) Read a document from the specified input source using the specified SAX reader settings.default JAXBTYPERead a document from the specified file.default JAXBTYPEread(InputStream aIS) Read a document from the specified input stream.default JAXBTYPERead a document from the specified reader.default JAXBTYPERead a document from the specified String.default JAXBTYPEread(ByteBuffer aXML) Read a document from the specified byte buffer.default JAXBTYPERead a document from the specified Path.default JAXBTYPEread(XMLEventReader aReader) Unmarshal root element to JAXB and return the resulting content tree.default JAXBTYPEread(XMLStreamReader aReader) Unmarshal root element to JAXB and return the resulting content tree.default JAXBTYPERead a document from the specified source.default JAXBTYPERead a document from the specified DOM node.default JAXBTYPEread(InputSource aInputSource) Read a document from the specified input source.
-
Method Details
-
isUseSchema
boolean isUseSchema()- Returns:
trueif an eventually configured XML Schema should be used,falseto explicitly disable the usage of XML Schema.- Since:
- 11.0.3
-
read
Read a document from the specified input source. The secure reading feature has affect when using this method.- Parameters:
aInputSource- The source to read. May not benull.- Returns:
nullin case reading fails.
-
read
@Nullable default JAXBTYPE read(@Nonnull com.helger.xml.serialize.read.SAXReaderSettings aSettings, @Nonnull InputSource aInputSource) Read a document from the specified input source using the specified SAX reader settings. The secure reading must be enabled in the SAX settings.- Parameters:
aSettings- The SAX Settings to use.aInputSource- The source to read. May not benull.- Returns:
nullin case reading fails.
-
read
Read a document from the specified input stream. The secure reading feature has affect when using this method.- Parameters:
aIS- The input stream to read. May not benull.- Returns:
nullin case reading fails.
-
read
Read a document from the specified reader. The secure reading feature has affect when using this method.- Parameters:
aReader- The reader to read. May not benull.- Returns:
nullin case reading fails.
-
read
Read a document from the specified file. The secure reading feature has affect when using this method.- Parameters:
aFile- The file to read. May not benull.- Returns:
nullin case reading fails.
-
read
Read a document from the specified Path. The secure reading feature has affect when using this method.- Parameters:
aPath- The path to read. May not benull.- Returns:
nullin case reading fails.
-
read
@Nullable default JAXBTYPE read(@Nonnull com.helger.commons.io.resource.IReadableResource aResource) Read a document from the specified resource. The secure reading feature has affect when using this method.- Parameters:
aResource- The resource to read. May not benull.- Returns:
nullin case reading fails.
-
read
Read a document from the specified input stream provider. The secure reading feature has affect when using this method.- Parameters:
aISP- The input stream provider to read. May not benull.- Returns:
nullin case reading fails.
-
read
Read a document from the specified byte array. The secure reading feature has affect when using this method.- Parameters:
aXML- The XML bytes to read. May not benull.- Returns:
nullin case reading fails.
-
read
Read a document from the specified byte array. The secure reading feature has affect when using this method.- Parameters:
aXML- The XML bytes to read. May not benull.nOfs- the offset in the buffer of the first byte to read.nLen- the maximum number of bytes to read from the buffer.- Returns:
nullin case reading fails.- Since:
- 10.1.4
-
read
Read a document from the specified byte buffer. The secure reading feature has affect when using this method.- Parameters:
aXML- The XML bytes to read. May not benull.- Returns:
nullin case reading fails.
-
read
Read a document from the specified String. The secure reading feature has affect when using this method.- Parameters:
sXML- The XML string to read. May not benull.- Returns:
nullin case reading fails.
-
read
Read a document from the specified char array. The secure reading feature has affect when using this method.- Parameters:
aXML- The XML string to read. May not benull.- Returns:
nullin case reading fails.
-
read
Read a document using the passed handler.- Parameters:
aHandler- The unmarshalling handler. May not benull.- Returns:
nullin case reading fails.
-
read
Read a document from the specified source. The secure reading feature has NO affect when using this method because the parameter type is too generic.- Parameters:
aSource- The source to read. May not benull.- Returns:
nullin case reading fails.
-
read
Read a document from the specified DOM node. The secure reading feature has NO affect when using this method because no parsing happens! To ensure secure reading the Node must first be serialized to a String and be parsed again!- Parameters:
aNode- The DOM node to read. May not benull.- Returns:
nullin case reading fails.
-
read
Unmarshal root element to JAXB and return the resulting content tree.- Parameters:
aReader- The parser to be read. May not benull.- Returns:
nullin case reading fails.
-
read
Unmarshal root element to JAXB and return the resulting content tree.- Parameters:
aReader- The parser to be read. May not benull.- Returns:
nullin case reading fails.
-