JAXBTYPE - The JAXB implementation class to be writtenIMPLTYPE - The implementation class implementing this abstract class.@NotThreadSafe public class JAXBWriterBuilder<JAXBTYPE,IMPLTYPE extends JAXBWriterBuilder<JAXBTYPE,IMPLTYPE>> extends AbstractWritingJAXBBuilder<JAXBTYPE,IMPLTYPE> implements IJAXBWriter<JAXBTYPE>
IJAXBWriter.IJAXBMarshaller<JAXBTYPE>m_aDocTypeUSE_JAXB_CHARSET_FIX| Constructor and Description |
|---|
JAXBWriterBuilder(IJAXBDocumentType aDocType) |
| Modifier and Type | Method and Description |
|---|---|
protected Marshaller |
createMarshaller()
Create the main marshaller with the contained settings.
|
Charset |
getCharset() |
String |
getIndentString() |
NamespaceContext |
getNamespaceContext() |
String |
getNoNamespaceSchemaLocation() |
String |
getSchemaLocation() |
ValidationEventHandler |
getValidationEventHandler() |
boolean |
isFormattedOutput() |
IMPLTYPE |
setCharset(Charset aCharset)
Set the charset to be used for writing JAXB objects.
|
IMPLTYPE |
setFormattedOutput(boolean bFormattedOutput)
Enable or disable the formatting of the output.
|
IMPLTYPE |
setIndentString(String sIndentString)
Set the indent string to be used for writing JAXB objects.
|
IMPLTYPE |
setNamespaceContext(NamespaceContext aNSContext)
Set the namespace context (prefix to namespace URL mapping) to be used.
|
IMPLTYPE |
setNoNamespaceSchemaLocation(String sNoNamespaceSchemaLocation)
Set the no namespace Schema Location to be used for writing JAXB objects.
|
IMPLTYPE |
setSchemaLocation(String sSchemaLocation)
Set the Schema Location to be used for writing JAXB objects.
|
IMPLTYPE |
setValidationEventHandler(ValidationEventHandler aEventHandler)
Set the JAXB validation event handler to be used.
|
String |
toString() |
com.helger.commons.state.ESuccess |
write(JAXBTYPE aJAXBDocument,
IJAXBWriter.IJAXBMarshaller<JAXBTYPE> aMarshallerFunc)
Convert the passed object to XML.
|
createJAXBElement, getMarshallerCustomizer, setMarshallerCustomizerexceptionCallbacks, getClassLoader, getJAXBContext, getJAXBDocumentType, getSchema, isUseJAXBContextCache, isUseSchema, setUseJAXBContextCache, setUseSchemaclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAsByteBuffer, getAsBytes, getAsDocument, getAsInputStream, getAsMicroDocument, getAsMicroElement, getAsString, getXMLWriterSettings, hasCharset, hasIndentString, hasNoNamespaceSchemaLocation, hasSchemaLocation, write, write, write, write, write, write, write, write, writepublic JAXBWriterBuilder(@Nonnull IJAXBDocumentType aDocType)
@Nullable public ValidationEventHandler getValidationEventHandler()
JAXBBuilderDefaultSettings.getDefaultValidationEventHandler()
is used.@Nonnull public final IMPLTYPE setValidationEventHandler(@Nullable ValidationEventHandler aEventHandler)
null.aEventHandler - The event handler to be used. May be null.@Nullable public NamespaceContext getNamespaceContext()
getNamespaceContext in interface IJAXBWriter<JAXBTYPE>JAXBBuilderDefaultSettings.getDefaultNamespaceContext() is
used.@Nonnull public final IMPLTYPE setNamespaceContext(@Nullable NamespaceContext aNSContext)
aNSContext - The namespace context to be used. May be null.public boolean isFormattedOutput()
isFormattedOutput in interface IJAXBWriter<JAXBTYPE>true if the JAXB output should be formatted. Default
is false.@Nonnull public final IMPLTYPE setFormattedOutput(boolean bFormattedOutput)
bFormattedOutput - true to enable it, false to disable it.@Nullable public Charset getCharset()
getCharset in interface IJAXBWriter<JAXBTYPE>null
by default.@Nonnull public final IMPLTYPE setCharset(@Nullable Charset aCharset)
aCharset - The charset to be used by default. May be null.@Nullable public String getIndentString()
getIndentString in interface IJAXBWriter<JAXBTYPE>null by default. Only used when formatted output is
used.@Nonnull public final IMPLTYPE setIndentString(@Nullable String sIndentString)
sIndentString - The indent string to be used. May be null.@Nullable public String getSchemaLocation()
getSchemaLocation in interface IJAXBWriter<JAXBTYPE>null by
default.@Nonnull public final IMPLTYPE setSchemaLocation(@Nullable String sSchemaLocation)
sSchemaLocation - The Schema Location to be used. May be null.@Nullable public String getNoNamespaceSchemaLocation()
getNoNamespaceSchemaLocation in interface IJAXBWriter<JAXBTYPE>null by default.@Nonnull public final IMPLTYPE setNoNamespaceSchemaLocation(@Nullable String sNoNamespaceSchemaLocation)
sNoNamespaceSchemaLocation - The no namespace Schema Location to be used. May be
null.@Nonnull protected Marshaller createMarshaller() throws JAXBException
AbstractWritingJAXBBuildercreateMarshaller in class AbstractWritingJAXBBuilder<JAXBTYPE,IMPLTYPE extends JAXBWriterBuilder<JAXBTYPE,IMPLTYPE>>null.JAXBException - In case creation fails@Nonnull public com.helger.commons.state.ESuccess write(@Nonnull JAXBTYPE aJAXBDocument, @Nonnull IJAXBWriter.IJAXBMarshaller<JAXBTYPE> aMarshallerFunc)
IJAXBWriterwrite in interface IJAXBWriter<JAXBTYPE>aJAXBDocument - The object to be converted. May not be null.aMarshallerFunc - The marshalling function. May not be null.ESuccesspublic String toString()
toString in class AbstractJAXBBuilder<IMPLTYPE extends JAXBWriterBuilder<JAXBTYPE,IMPLTYPE>>Copyright © 2015–2021 Philip Helger. All rights reserved.