Interface IXMLWriterSettings

All Known Implementing Classes:
XMLWriterSettings

public interface IXMLWriterSettings
Interface for the settings to be used for serializing XML nodes.
Author:
Philip Helger
  • Method Details

    • getXMLVersion

      @Nonnull EXMLVersion getXMLVersion()
      Returns:
      The XML version to use. Default is 1.0
    • getSerializeVersion

      @Nonnull EXMLSerializeVersion getSerializeVersion()
      Returns:
      The XML serialize version to use. Default is XML 1.0
    • getSerializeXMLDeclaration

      @Nonnull EXMLSerializeXMLDeclaration getSerializeXMLDeclaration()
      Returns:
      Write XML declaration? Default is true.
    • isNewLineAfterXMLDeclaration

      boolean isNewLineAfterXMLDeclaration()
      Returns:
      true if a newline should be added after the XML declaration or not. Defaults to true.
      Since:
      9.3.5
    • getSerializeDocType

      @Nonnull EXMLSerializeDocType getSerializeDocType()
      Returns:
      Write document type? Default is true.
    • getSerializeComments

      @Nonnull EXMLSerializeComments getSerializeComments()
      Returns:
      Write comments? Default is true.
    • getIndent

      Returns:
      Indent and/or align code? Default is indent and aligned.
    • getIndentDeterminator

      @Nonnull IXMLIndentDeterminator getIndentDeterminator()
      Returns:
      The dynamic (per-element) indentation determinator. This must be changed when e.g. serializing HTML. Never null.
    • getIncorrectCharacterHandling

      @Nonnull EXMLIncorrectCharacterHandling getIncorrectCharacterHandling()
      Returns:
      The incorrect character handling to be used. May not be null.
    • getCharset

      @Nonnull Charset getCharset()
      Returns:
      The charset to use. May never be null.
    • getNamespaceContext

      @Nonnull NamespaceContext getNamespaceContext()
      Returns:
      The namespace context to be used. Never null.
    • isUseDoubleQuotesForAttributes

      boolean isUseDoubleQuotesForAttributes()
      Returns:
      true if attribute values should be enclosed in double quotes, false if single quotes should be used.
    • getBracketModeDeterminator

      @Nonnull IXMLBracketModeDeterminator getBracketModeDeterminator()
      Returns:
      The dynamic (per-element) bracket mode determinator to use. This must be changed when e.g. serializing HTML. Never null .
    • isSpaceOnSelfClosedElement

      boolean isSpaceOnSelfClosedElement()
      Determine if a self closed element (an element having no children) should be emitted with a space at the end (<br />) or not ( <br/>)
      Returns:
      true if a space should be emitted, false if no space should be emitted.
    • getNewLineMode

      @Nonnull com.helger.commons.system.ENewLineMode getNewLineMode()
      Returns:
      The newline mode to be used. By default it is the platform specific new line mode. Never null.
    • getNewLineString

      @Nonnull @Nonempty default String getNewLineString()
      Returns:
      The string representing the new line mode. A shortcut for getNewLineMode ().getText().
    • getIndentationString

      @Nonnull @Nonempty String getIndentationString()
      Returns:
      The string to be used for indentation of a single level. By default it is 2 spaces.
    • isEmitNamespaces

      boolean isEmitNamespaces()
      Determine if namespaces should be emitted or not.
      Returns:
      true if namespaces should be emitted, false if all created elements should reside in the default namespace.
    • isPutNamespaceContextPrefixesInRoot

      boolean isPutNamespaceContextPrefixesInRoot()
      Check if the flag for putting all namespace prefixes specified in the namespace context should be put in the root document. This setting only has an effect if a namespace context is defined and if it implements the IIterableNamespaceContext interface!
      Returns:
      true if it is enabled, false if not.
    • isWriteCDATAAsText

      boolean isWriteCDATAAsText()
      Check if all CDATA children should be emitted as normal text or not. This is required for XML canonicalization.
      Returns:
      true if CDATA should be written as text, false to keep CDATA as it is.
      Since:
      9.1.4
    • isOrderAttributesAndNamespaces

      boolean isOrderAttributesAndNamespaces()
      Determine if attributes of elements and namespaces should be emitted in alphabetical order or not. This is required for XML canonicalization.
      Returns:
      true to order attributes, false to keep the original order.
      Since:
      9.1.4