Class JAXBWriterBuilder<JAXBTYPE,IMPLTYPE extends JAXBWriterBuilder<JAXBTYPE,IMPLTYPE>>

java.lang.Object
com.helger.jaxb.builder.AbstractJAXBBuilder<IMPLTYPE>
com.helger.jaxb.builder.AbstractWritingJAXBBuilder<JAXBTYPE,IMPLTYPE>
com.helger.jaxb.builder.JAXBWriterBuilder<JAXBTYPE,IMPLTYPE>
Type Parameters:
JAXBTYPE - The JAXB implementation class to be written
IMPLTYPE - The implementation class implementing this abstract class.
All Implemented Interfaces:
com.helger.commons.lang.IHasClassLoader, com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>, IJAXBWriter<JAXBTYPE>

@NotThreadSafe @Deprecated(forRemoval=true, since="11.0.0") public class JAXBWriterBuilder<JAXBTYPE,IMPLTYPE extends JAXBWriterBuilder<JAXBTYPE,IMPLTYPE>> extends AbstractWritingJAXBBuilder<JAXBTYPE,IMPLTYPE> implements IJAXBWriter<JAXBTYPE>
Deprecated, for removal: This API element is subject to removal in a future version.
Since v11 - use the GenericJAXBMarshaller instead - it deals with all of the stuff in one class. Will be removed in v12
Builder class for writing JAXB documents.
Author:
Philip Helger
  • Constructor Details

    • JAXBWriterBuilder

      public JAXBWriterBuilder(@Nonnull IJAXBDocumentType aDocType)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getValidationEventHandler

      @Nullable public jakarta.xml.bind.ValidationEventHandler getValidationEventHandler()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The special JAXB validation event handler to be used. By default JAXBBuilderDefaultSettings.getDefaultValidationEventHandler() is used.
    • setValidationEventHandler

      @Nonnull public final IMPLTYPE setValidationEventHandler(@Nullable jakarta.xml.bind.ValidationEventHandler aEventHandler)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the JAXB validation event handler to be used. May be null.
      Parameters:
      aEventHandler - The event handler to be used. May be null.
      Returns:
      this for chaining
    • getNamespaceContext

      @Nullable public NamespaceContext getNamespaceContext()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getNamespaceContext in interface IJAXBWriter<JAXBTYPE>
      Returns:
      The special JAXB namespace context to be used. By default JAXBBuilderDefaultSettings.getDefaultNamespaceContext() is used.
    • setNamespaceContext

      @Nonnull public final IMPLTYPE setNamespaceContext(@Nullable NamespaceContext aNSContext)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the namespace context (prefix to namespace URL mapping) to be used.
      Parameters:
      aNSContext - The namespace context to be used. May be null.
      Returns:
      this for chaining
    • isFormattedOutput

      public boolean isFormattedOutput()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      isFormattedOutput in interface IJAXBWriter<JAXBTYPE>
      Returns:
      true if the JAXB output should be formatted. Default is false.
    • setFormattedOutput

      @Nonnull public final IMPLTYPE setFormattedOutput(boolean bFormattedOutput)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Enable or disable the formatting of the output.
      Parameters:
      bFormattedOutput - true to enable it, false to disable it.
      Returns:
      this for chaining
    • getCharset

      @Nullable public Charset getCharset()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getCharset in interface IJAXBWriter<JAXBTYPE>
      Returns:
      The special JAXB Charset to be used for writing. null by default.
    • setCharset

      @Nonnull public final IMPLTYPE setCharset(@Nullable Charset aCharset)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the charset to be used for writing JAXB objects.
      Parameters:
      aCharset - The charset to be used by default. May be null.
      Returns:
      this for chaining
    • getIndentString

      @Nullable public String getIndentString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getIndentString in interface IJAXBWriter<JAXBTYPE>
      Returns:
      The JAXB indentation string to be used for writing. null by default. Only used when formatted output is used.
    • setIndentString

      @Nonnull public final IMPLTYPE setIndentString(@Nullable String sIndentString)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the indent string to be used for writing JAXB objects.
      Parameters:
      sIndentString - The indent string to be used. May be null.
      Returns:
      this for chaining
    • getSchemaLocation

      @Nullable public String getSchemaLocation()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getSchemaLocation in interface IJAXBWriter<JAXBTYPE>
      Returns:
      The schema location to be used for writing. null by default.
    • setSchemaLocation

      @Nonnull public final IMPLTYPE setSchemaLocation(@Nullable String sSchemaLocation)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the Schema Location to be used for writing JAXB objects.
      Parameters:
      sSchemaLocation - The Schema Location to be used. May be null.
      Returns:
      this for chaining
      Since:
      8.6.0
    • getNoNamespaceSchemaLocation

      @Nullable public String getNoNamespaceSchemaLocation()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getNoNamespaceSchemaLocation in interface IJAXBWriter<JAXBTYPE>
      Returns:
      The no namespace schema location to be used for writing. null by default.
    • setNoNamespaceSchemaLocation

      @Nonnull public final IMPLTYPE setNoNamespaceSchemaLocation(@Nullable String sNoNamespaceSchemaLocation)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the no namespace Schema Location to be used for writing JAXB objects.
      Parameters:
      sNoNamespaceSchemaLocation - The no namespace Schema Location to be used. May be null.
      Returns:
      this for chaining
      Since:
      9.0.0
    • createMarshaller

      @Nonnull protected jakarta.xml.bind.Marshaller createMarshaller() throws jakarta.xml.bind.JAXBException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: AbstractWritingJAXBBuilder
      Create the main marshaller with the contained settings.
      Overrides:
      createMarshaller in class AbstractWritingJAXBBuilder<JAXBTYPE,IMPLTYPE extends JAXBWriterBuilder<JAXBTYPE,IMPLTYPE>>
      Returns:
      The Marshaller and never null.
      Throws:
      jakarta.xml.bind.JAXBException - In case creation fails
    • write

      @Nonnull public com.helger.commons.state.ESuccess write(@Nonnull JAXBTYPE aJAXBDocument, @Nonnull IJAXBMarshaller<JAXBTYPE> aMarshallerFunc)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IJAXBWriter
      Convert the passed object to XML.
      Specified by:
      write in interface IJAXBWriter<JAXBTYPE>
      Parameters:
      aJAXBDocument - The object to be converted. May not be null.
      aMarshallerFunc - The marshalling function. May not be null.
      Returns:
      ESuccess
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class AbstractJAXBBuilder<IMPLTYPE extends JAXBWriterBuilder<JAXBTYPE,IMPLTYPE>>