JAXBTYPE - The JAXB type to be writtenpublic interface IJAXBWriter<JAXBTYPE>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
IJAXBWriter.IJAXBMarshaller<JAXBTYPE>
A special bi-consumer that additionally can throw a
JAXBException |
| Modifier and Type | Field and Description |
|---|---|
static boolean |
USE_JAXB_CHARSET_FIX
Use the
SafeXMLStreamWriter where applicable to ensure valid XML is
created? |
| Modifier and Type | Method and Description |
|---|---|
default ByteBuffer |
getAsByteBuffer(JAXBTYPE aObject)
Write the passed object to a
ByteBuffer and return it (write). |
default byte[] |
getAsBytes(JAXBTYPE aObject)
Write the passed object to a byte array and return the created byte array
(write).
|
default Document |
getAsDocument(JAXBTYPE aObject)
Convert the passed object to a new DOM document (write).
|
default com.helger.commons.io.stream.NonBlockingByteArrayInputStream |
getAsInputStream(JAXBTYPE aObject)
Write the passed object to a byte array and return the input stream on that
array.
|
default com.helger.xml.microdom.IMicroDocument |
getAsMicroDocument(JAXBTYPE aObject)
Convert the passed object to a new micro document (write).
|
default com.helger.xml.microdom.IMicroElement |
getAsMicroElement(JAXBTYPE aObject)
Convert the passed object to a new micro document and return only the root
element (write).
|
default String |
getAsString(JAXBTYPE aObject)
Utility method to directly convert the passed domain object to an XML
string (write).
|
Charset |
getCharset() |
String |
getIndentString() |
NamespaceContext |
getNamespaceContext() |
String |
getNoNamespaceSchemaLocation() |
String |
getSchemaLocation() |
default com.helger.xml.serialize.write.IXMLWriterSettings |
getXMLWriterSettings() |
default boolean |
hasCharset() |
default boolean |
hasIndentString() |
default boolean |
hasNoNamespaceSchemaLocation() |
default boolean |
hasSchemaLocation() |
boolean |
isFormattedOutput() |
default com.helger.commons.state.ESuccess |
write(JAXBTYPE aObject,
ByteBuffer aBuffer)
Write the passed object to a
ByteBuffer. |
default com.helger.commons.state.ESuccess |
write(JAXBTYPE aObject,
ContentHandler aHandler)
Convert the passed object to XML.
|
default com.helger.commons.state.ESuccess |
write(JAXBTYPE aObject,
File aResultFile)
Write the passed object to a
File. |
com.helger.commons.state.ESuccess |
write(JAXBTYPE aObject,
IJAXBWriter.IJAXBMarshaller<JAXBTYPE> aMarshallerFunc)
Convert the passed object to XML.
|
default com.helger.commons.state.ESuccess |
write(JAXBTYPE aObject,
com.helger.commons.io.resource.IWritableResource aResource)
Write the passed object to an
IWritableResource. |
default com.helger.commons.state.ESuccess |
write(JAXBTYPE aObject,
OutputStream aOS)
Write the passed object to an
OutputStream. |
default com.helger.commons.state.ESuccess |
write(JAXBTYPE aObject,
Path aResultPath)
Write the passed object to a
Path. |
default com.helger.commons.state.ESuccess |
write(JAXBTYPE aObject,
Result aResult)
Convert the passed object to XML.
|
default com.helger.commons.state.ESuccess |
write(JAXBTYPE aObject,
Writer aWriter)
Write the passed object to a
Writer. |
default com.helger.commons.state.ESuccess |
write(JAXBTYPE aObject,
XMLStreamWriter aWriter)
Convert the passed object to XML.
|
static final boolean USE_JAXB_CHARSET_FIX
SafeXMLStreamWriter where applicable to ensure valid XML is
created? This is a work around for
https://github.com/eclipse-ee4j/jaxb-ri/issues/614 and
https://github.com/eclipse-ee4j/jaxb-ri/issues/960@Nullable NamespaceContext getNamespaceContext()
null.boolean isFormattedOutput()
true if the JAXB output should be formatted. Default
is false.@Nullable Charset getCharset()
null
by default.default boolean hasCharset()
@Nullable String getIndentString()
null by default. Only used when formatted output is
used.default boolean hasIndentString()
@Nullable String getSchemaLocation()
null by
default.default boolean hasSchemaLocation()
@Nullable String getNoNamespaceSchemaLocation()
null by default.default boolean hasNoNamespaceSchemaLocation()
@Nonnull default com.helger.xml.serialize.write.IXMLWriterSettings getXMLWriterSettings()
null.@Nonnull default com.helger.commons.state.ESuccess write(@Nonnull JAXBTYPE aObject, @Nonnull File aResultFile)
File.aObject - The object to be written. May not be null.aResultFile - The result file to be written to. May not be null.ESuccess@Nonnull default com.helger.commons.state.ESuccess write(@Nonnull JAXBTYPE aObject, @Nonnull Path aResultPath)
Path.aObject - The object to be written. May not be null.aResultPath - The result path to be written to. May not be null.ESuccess@Nonnull default com.helger.commons.state.ESuccess write(@Nonnull JAXBTYPE aObject, @Nonnull @WillClose OutputStream aOS)
OutputStream.aObject - The object to be written. May not be null.aOS - The output stream to write to. Will always be closed. May not be
null.ESuccess@Nonnull default com.helger.commons.state.ESuccess write(@Nonnull JAXBTYPE aObject, @Nonnull @WillClose Writer aWriter)
Writer.aObject - The object to be written. May not be null.aWriter - The writer to write to. Will always be closed. May not be
null.ESuccess@Nonnull default com.helger.commons.state.ESuccess write(@Nonnull JAXBTYPE aObject, @Nonnull ByteBuffer aBuffer)
ByteBuffer.aObject - The object to be written. May not be null.aBuffer - The byte buffer to write to. If the buffer is too small, it is
automatically extended. May not be null.ESuccessBufferOverflowException - If the ByteBuffer is too small@Nonnull default com.helger.commons.state.ESuccess write(@Nonnull JAXBTYPE aObject, @Nonnull com.helger.commons.io.resource.IWritableResource aResource)
IWritableResource.aObject - The object to be written. May not be null.aResource - The result resource to be written to. May not be null.ESuccess@Nonnull com.helger.commons.state.ESuccess write(@Nonnull JAXBTYPE aObject, @Nonnull IJAXBWriter.IJAXBMarshaller<JAXBTYPE> aMarshallerFunc)
aObject - The object to be converted. May not be null.aMarshallerFunc - The marshalling function. May not be null.ESuccess@Nonnull default com.helger.commons.state.ESuccess write(@Nonnull JAXBTYPE aObject, @Nonnull Result aResult)
SafeXMLStreamWriter it is ensured that only valid XML is
created!aObject - The object to be converted. May not be null.aResult - The result object holder. May not be null. Usually
SAXResult, DOMResult and StreamResult are supported.ESuccess@Nonnull default com.helger.commons.state.ESuccess write(@Nonnull JAXBTYPE aObject, @Nonnull ContentHandler aHandler)
aObject - The object to be converted. May not be null.aHandler - XML will be sent to this handler as SAX2 events. May not be
null.ESuccess@Nonnull default com.helger.commons.state.ESuccess write(@Nonnull JAXBTYPE aObject, @Nonnull @WillClose XMLStreamWriter aWriter)
aObject - The object to be converted. May not be null.aWriter - XML will be sent to this writer. May not be null.ESuccess@Nullable default Document getAsDocument(@Nonnull JAXBTYPE aObject)
aObject - The object to be converted. May not be null.null if converting the document failed.@Nullable default com.helger.xml.microdom.IMicroDocument getAsMicroDocument(@Nonnull JAXBTYPE aObject)
aObject - The object to be converted. May not be null.null if converting the document failed.@Nullable default com.helger.xml.microdom.IMicroElement getAsMicroElement(@Nonnull JAXBTYPE aObject)
aObject - The object to be converted. May not be null.null if converting the document failed.@Nullable default String getAsString(@Nonnull JAXBTYPE aObject)
aObject - The domain object to be converted. May not be null.null if the passed domain object could not be
converted because of validation errors.@Nullable default ByteBuffer getAsByteBuffer(@Nonnull JAXBTYPE aObject)
ByteBuffer and return it (write).aObject - The object to be written. May not be null.null if the passed domain object could not be
converted because of validation errors.@Nullable default byte[] getAsBytes(@Nonnull JAXBTYPE aObject)
aObject - The object to be written. May not be null.null if the passed domain object could not be
converted because of validation errors.@Nullable default com.helger.commons.io.stream.NonBlockingByteArrayInputStream getAsInputStream(@Nonnull JAXBTYPE aObject)
aObject - The object to be written. May not be null.null if the passed domain object could not be
converted because of validation errors.Copyright © 2015–2021 Philip Helger. All rights reserved.