Package net.sf.saxon.s9api
Enum Class Serializer.Property
- All Implemented Interfaces:
Serializable,Comparable<Serializer.Property>,Constable
- Enclosing class:
Serializer
Enumeration class defining the permitted serialization properties.
Names prefixed SAXON are extension properties defined at
https://www.saxonica.com/documentation/index.html#!extensions/output-extras/serialization-parameters
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSet to "yes" or "no" to indicate whether duplicate names are to be allowed in JSON output (the main reason to set this to "yes" is to avoid the cost of checking for duplicates when it is known there will be none)Build-tree option (XSLT only), "yes" or "no"Set to "yes" or "no" to indicate whether a byte order mark is to be writtenSet to "yes" or "no" to indicate whether a byte order mark is to be writtenSpace-separated list of QNames (in Clark form or EQName form) of elements whose content is to be wrapped in CDATA sectionsSet to any string to indicate that the output is to include a DOCTYPE declaration with this public idSet to any string to indicate that the output is to include a DOCTYPE declaration with this system idCharacter encoding of output streamSet to "yes" or "no" to indicate whether a solidus (forwards slash) is to be escaped with a backslash in JSON output.Set to "yes" or "no" to indicate (for HTML and XHTML) whether URI-valued attributes should be percent-encodedHTML version numberFor HTML and XHTML, set to "yes" or "no" to indicate whether a <meta> element is to be written to indicate the content type and encodingSet to "yes" or "no" to indicate whether indentation is requiredSet to a string that will be used to separate adjacent items in an XQuery result sequenceIndicates output in JSON Lines format - one JSON record per line of the output file, newline-separatedOutput method to be used when nodes are embedded in maps or arrays output using the JSON output methodSet to indicate the media type (MIME type) of the outputSerialization method: xml, html, xhtml, text, json, adaptive; orQ{uri}localSet to the name of a Unicode normalization form: "NFC", "NFD", "NFKC", or "NFKD", or "none" to indicate no normalizationSet to "yes" if the XML declaration is to be omitted from the output fileSaxon extension: set to a space-separated list of attribute names, in Clark or EQName notation, followed optionally by "*" and then another space-separated list of attribute names indicating that attributes present in the list should be serialized in the order indicated: specific attributes listed before the "*" come first in the order specified; then attributes not present in the list (these are sorted first by namespace, then by local name), and finally specific attributes listed after the "*", in the order specified.Saxon extension (now in 4.0): request canonical XML output.Saxon extension to indicate how characters outside the encoding should be represented, for example "hex" for hexadecimal character references, "decimal" for decimal character referencesSaxon extension for use in conjunction withCDATA_SECTION_ELEMENTS: when an element is named inCDATA_SECTION_ELEMENTS, and this property is set, then CDATA tags are output around a text node only if it includes an ampersand or less-than sign.Saxon extension: set to a space-separated list of element names, in Clark or EQName notation, representing elements that will be preceded by an extra blank line in the output in addition to normal indentation.Saxon extension: set to an integer (represented as a string) giving the number of spaces by which each level of nesting should be indented.Saxon extension: set to a string containing the internal DTD subset, which is output "as is", without any checking.Saxon extension: set to an integer (represented as a string) giving the desired maximum length of lines when indenting.Saxon extension: set to any string.Saxon extension: set to a space-separated list of strings, followed optionally by "*" and then another space-separated list of strings indicating that keys present in a map should be serialized in the order indicated: specific keys listed before the "*" come first in the order specified; then keys not present in the list (these are sorted alphabetically, and finally specific keys listed after the "*", in the order specified.Saxon extension for use when writing to the text output method; this option causes the processing instructions hex and b64 to be recognized as containing hexBinary or base64 data respectively.Saxon extension for use when output is sent to a SAX ContentHandler: indicates that the output is required to be well-formed (exactly one top-level element, no top-level text nodes)Set to "yes" or "no" to indicate whether attribute values should be delimited where possible using single quotes (apostrophes) rather than double quotes.Set to the version of the serialization specification to be used, for example "3.1" or "4.0".Saxon extension for interfacing with debuggers; indicates that location information is available for events in this output streamSaxon extension, indicates that the output of a query is to be wrapped before serialization, such that each item in the result sequence is enclosed in an element indicating its typeSet to "yes", "no", or "omit" to indicate the required value of the standalone attribute in the XML declaration of the output fileSet to a space-separated list of element names (in Clark or EQName notation), identifying elements (such aspara) within which no content is to be indented.Set to "yes" or "no" to indicate (for XML 1.1) whether namespaces that go out of scope should be undeclaredList of names of character maps to be used.Version of output method, for example "1.0" or "1.1" for XML -
Method Summary
Modifier and TypeMethodDescriptionstatic Serializer.PropertygetQName()Get the name of the property expressed as a QName.toString()Get the name of the property expressed as a QName in Clark notation.static Serializer.PropertyReturns the enum constant of this class with the specified name.static Serializer.Property[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ALLOW_DUPLICATE_NAMES
Set to "yes" or "no" to indicate whether duplicate names are to be allowed in JSON output (the main reason to set this to "yes" is to avoid the cost of checking for duplicates when it is known there will be none) -
BYTE_ORDER_MARK
Set to "yes" or "no" to indicate whether a byte order mark is to be written -
CANONICAL
Set to "yes" or "no" to indicate whether a byte order mark is to be written -
CDATA_SECTION_ELEMENTS
Space-separated list of QNames (in Clark form or EQName form) of elements whose content is to be wrapped in CDATA sections -
DOCTYPE_PUBLIC
Set to any string to indicate that the output is to include a DOCTYPE declaration with this public id -
DOCTYPE_SYSTEM
Set to any string to indicate that the output is to include a DOCTYPE declaration with this system id -
ENCODING
Character encoding of output stream -
ESCAPE_SOLIDUS
Set to "yes" or "no" to indicate whether a solidus (forwards slash) is to be escaped with a backslash in JSON output. (The backslash is only really needed when the JSON is to be embedded in HTML, but the values is "yes" by default.) New in 4.0 -
ESCAPE_URI_ATTRIBUTES
Set to "yes" or "no" to indicate (for HTML and XHTML) whether URI-valued attributes should be percent-encoded -
HTML_VERSION
HTML version number -
INCLUDE_CONTENT_TYPE
For HTML and XHTML, set to "yes" or "no" to indicate whether a <meta> element is to be written to indicate the content type and encoding -
INDENT
Set to "yes" or "no" to indicate whether indentation is required -
ITEM_SEPARATOR
Set to a string that will be used to separate adjacent items in an XQuery result sequence -
JSON_LINES
Indicates output in JSON Lines format - one JSON record per line of the output file, newline-separated -
JSON_NODE_OUTPUT_METHOD
Output method to be used when nodes are embedded in maps or arrays output using the JSON output method -
MEDIA_TYPE
Set to indicate the media type (MIME type) of the output -
METHOD
Serialization method: xml, html, xhtml, text, json, adaptive; orQ{uri}local -
NORMALIZATION_FORM
Set to the name of a Unicode normalization form: "NFC", "NFD", "NFKC", or "NFKD", or "none" to indicate no normalization -
OMIT_XML_DECLARATION
Set to "yes" if the XML declaration is to be omitted from the output file -
STANDALONE
Set to "yes", "no", or "omit" to indicate the required value of the standalone attribute in the XML declaration of the output file -
SUPPRESS_INDENTATION
Set to a space-separated list of element names (in Clark or EQName notation), identifying elements (such aspara) within which no content is to be indented. This is typically because the element contains mixed content in which whitespace is significant.This was originally a Saxon extension to the W3C specifications, but it then became a standard serialization attribute. In previous versions of this API it was therefore named
SAXON_SUPPRESS_INDENTATION -
UNDECLARE_PREFIXES
Set to "yes" or "no" to indicate (for XML 1.1) whether namespaces that go out of scope should be undeclared -
USE_CHARACTER_MAPS
List of names of character maps to be used. Character maps can only be specified in an XSLT stylesheet. Supplied as a space-separated list of QNames in Clark or EQName format. -
VERSION
Version of output method, for example "1.0" or "1.1" for XML -
BUILD_TREE
Build-tree option (XSLT only), "yes" or "no" -
SAXON_ATTRIBUTE_ORDER
Saxon extension: set to a space-separated list of attribute names, in Clark or EQName notation, followed optionally by "*" and then another space-separated list of attribute names indicating that attributes present in the list should be serialized in the order indicated: specific attributes listed before the "*" come first in the order specified; then attributes not present in the list (these are sorted first by namespace, then by local name), and finally specific attributes listed after the "*", in the order specified. -
SAXON_CANONICAL
Saxon extension (now in 4.0): request canonical XML output. Value is "yes" or "no" -
SAXON_CHARACTER_REPRESENTATION
Saxon extension to indicate how characters outside the encoding should be represented, for example "hex" for hexadecimal character references, "decimal" for decimal character references -
SAXON_CONDITIONAL_CDATA
Saxon extension for use in conjunction withCDATA_SECTION_ELEMENTS: when an element is named inCDATA_SECTION_ELEMENTS, and this property is set, then CDATA tags are output around a text node only if it includes an ampersand or less-than sign. -
SAXON_DOUBLE_SPACE
Saxon extension: set to a space-separated list of element names, in Clark or EQName notation, representing elements that will be preceded by an extra blank line in the output in addition to normal indentation. -
SAXON_INDENT_SPACES
Saxon extension: set to an integer (represented as a string) giving the number of spaces by which each level of nesting should be indented. Default is 3. -
SAXON_INTERNAL_DTD_SUBSET
Saxon extension: set to a string containing the internal DTD subset, which is output "as is", without any checking. The content should correspond to the rules for theintSubsetproduction in the XML 1.1 grammar (note that this excludes the square-bracket delimiters). See also thesaxon:doctypeinstruction, which allows the internal subset to be constructed programmatically. -
SAXON_LINE_LENGTH
Saxon extension: set to an integer (represented as a string) giving the desired maximum length of lines when indenting. Default is 80. -
SAXON_NEWLINE
Saxon extension: set to any string. Indicates the sequence of characters used to represent a newline in the text output method, and in newlines used for indentation in any output methods that use indentation. -
SAXON_PROPERTY_ORDER
Saxon extension: set to a space-separated list of strings, followed optionally by "*" and then another space-separated list of strings indicating that keys present in a map should be serialized in the order indicated: specific keys listed before the "*" come first in the order specified; then keys not present in the list (these are sorted alphabetically, and finally specific keys listed after the "*", in the order specified. It is not possible to include keys that contain whitespace. -
SAXON_RECOGNIZE_BINARY
Saxon extension for use when writing to the text output method; this option causes the processing instructions hex and b64 to be recognized as containing hexBinary or base64 data respectively. -
SAXON_REQUIRE_WELL_FORMED
Saxon extension for use when output is sent to a SAX ContentHandler: indicates that the output is required to be well-formed (exactly one top-level element, no top-level text nodes) -
SAXON_SINGLE_QUOTES
Set to "yes" or "no" to indicate whether attribute values should be delimited where possible using single quotes (apostrophes) rather than double quotes. -
SAXON_SPEC_VERSION
Set to the version of the serialization specification to be used, for example "3.1" or "4.0". Defaults to 3.1. -
SAXON_SUPPLY_SOURCE_LOCATOR
Saxon extension for interfacing with debuggers; indicates that location information is available for events in this output stream -
SAXON_WRAP
Saxon extension, indicates that the output of a query is to be wrapped before serialization, such that each item in the result sequence is enclosed in an element indicating its type
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
toString
Get the name of the property expressed as a QName in Clark notation. The namespace will be null for standard serialization properties, and will be the Saxon namespacehttp://saxon.sf.net/for Saxon extensions- Overrides:
toStringin classEnum<Serializer.Property>- Returns:
- the name of the serialization property as a QName in Clark notation, {uri}local
-
getQName
Get the name of the property expressed as a QName. The namespace will be null for standard serialization properties, and will be the Saxon namespacehttp://saxon.sf.net/for Saxon extensions- Returns:
- the name of the serialization property as a QName
-
get
-