Package com.helger.xml.serialize.write
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 Summary
Modifier and TypeMethodDescriptioncom.helger.commons.system.ENewLineModedefault StringbooleanDetermine if namespaces should be emitted or not.booleanbooleanDetermine if attributes of elements and namespaces should be emitted in alphabetical order or not.booleanCheck if the flag for putting all namespace prefixes specified in the namespace context should be put in the root document.booleanDetermine if a self closed element (an element having no children) should be emitted with a space at the end (<br />) or not (<br/>)booleanbooleanCheck if all CDATA children should be emitted as normal text or not.
-
Method Details
-
getXMLVersion
- Returns:
- The XML version to use. Default is
1.0
-
getSerializeVersion
- Returns:
- The XML serialize version to use. Default is
XML 1.0
-
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
- Returns:
- Write document type? Default is
true.
-
getSerializeComments
- Returns:
- Write comments? Default is
true.
-
getIndent
- Returns:
- Indent and/or align code? Default is
indent and aligned.
-
getIndentDeterminator
- Returns:
- The dynamic (per-element) indentation determinator. This must be
changed when e.g. serializing HTML. Never
null.
-
getIncorrectCharacterHandling
- Returns:
- The incorrect character handling to be used. May not be
null.
-
getCharset
- Returns:
- The charset to use. May never be
null.
-
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
- 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
- Returns:
- The newline mode to be used. By default it is the platform specific
new line mode. Never
null.
-
getNewLineString
- Returns:
- The string representing the new line mode. A shortcut for
getNewLineMode ().getText().
-
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
-