Package com.helger.xml.serialize.write
Interface IXMLWriterSettings
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
XMLWriterSettings
public interface IXMLWriterSettings extends Serializable
Interface for the settings to be used for serializing XML nodes.- Author:
- Philip Helger
-
-
Method Summary
-
-
-
Method Detail
-
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:
trueif a newline should be added after the XML declaration or not. Defaults totrue.- 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
@Nonnull EXMLSerializeIndent 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.
-
getNamespaceContext
@Nonnull INamespaceContext getNamespaceContext()
- Returns:
- The namespace context to be used. Never
null.
-
isUseDoubleQuotesForAttributes
boolean isUseDoubleQuotesForAttributes()
- Returns:
trueif attribute values should be enclosed in double quotes,falseif 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:
trueif a space should be emitted,falseif 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:
trueif namespaces should be emitted,falseif 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 theIIterableNamespaceContextinterface!- Returns:
trueif it is enabled,falseif not.
-
isWriteCDATAAsText
boolean isWriteCDATAAsText()
Check if all CDATA children should be emitted as normal text or not. This is required for XML canonicalization.- Returns:
trueif CDATA should be written as text,falseto 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:
trueto order attributes,falseto keep the original order.- Since:
- 9.1.4
-
-