Package org.rumbledb.serialization
Class SerializationParameters
java.lang.Object
org.rumbledb.serialization.SerializationParameters
- All Implemented Interfaces:
Serializable
Serialization parameters with the fixed fn:serialize map defaults from F&O 3.1.
RumbleDB also uses these defaults for fn:serialize with omitted or XML parameters.
Field initializers apply to every new instance; mutable collections belong to that instance.
Application output defaults are selected separately by
defaults(String).- See Also:
-
- F&O 3.1 fn:serialize
Specification references:
- XQuery 3.1 Static Context Components — default serialization parameters (link: https://www.w3.org/TR/xquery-31/#id-xq-static-context-components)
- XSLT and XQuery Serialization 3.1 — Serialization Parameters (link: https://www.w3.org/TR/xslt-xquery-serialization-31/#serparam)
- Serialized Form
- F&O 3.1 fn:serialize
Specification references:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyLanguageDefaults(String queryLanguage) Reapplies language defaults when parsing detects a different language; explicit options are preserved.static SerializationParameterscopy(SerializationParameters parameters) Returns a copy of the SerializationParameters instance.static SerializationParametersdefaults()static SerializationParametersApplication output defaults.booleanbooleanbooleanbooleanbooleanAn explicit media type takes precedence.Returns the method name, accepting the equivalent Q{}name spelling for standard methods.booleanRequested HTML version for the HTML/XHTML output methods.booleanbooleanWhether the requested HTML version denotes HTML5.void
-
Constructor Details
-
SerializationParameters
public SerializationParameters()
-
-
Method Details
-
setMethod
-
applyLanguageDefaults
Reapplies language defaults when parsing detects a different language; explicit options are preserved. -
defaults
-
defaults
Application output defaults. JSONiq uses the hybrid method and XQuery uses XML. Both leave item-separator absent so sequence normalization supplies atomic-value spaces. fn:serialize uses the standard field defaults through the no-argument constructor instead. -
getMethod
Returns the method name, accepting the equivalent Q{}name spelling for standard methods. -
getMediaType
An explicit media type takes precedence. Otherwise choose a suitable type for the current method, so overriding the method never leaves a stale default media type behind. -
getOmitXmlDeclaration
public boolean getOmitXmlDeclaration() -
getUndeclarePrefixes
public boolean getUndeclarePrefixes() -
getIncludeContentType
public boolean getIncludeContentType() -
getEscapeUriAttributes
public boolean getEscapeUriAttributes() -
getRequestedHtmlVersion
Requested HTML version for the HTML/XHTML output methods. Per XSLT and XQuery Serialization 3.1, the requested HTML version is the value ofhtml-versionwhen that parameter is present; otherwise it falls back toversion.- Returns:
- the requested HTML version, or
nullif neither parameter is set
-
isRequestedHtml5Version
public boolean isRequestedHtml5Version()Whether the requested HTML version denotes HTML5. This check is intentionally narrow: we recognize the specific lexical forms that should trigger the HTML5 branch (5and5.0) without treating arbitrary version strings as decimals.- Returns:
trueif the requested HTML version is"5"or"5.0"
-
getByteOrderMark
public boolean getByteOrderMark() -
getIndent
public boolean getIndent() -
getAllowDuplicateNames
public boolean getAllowDuplicateNames() -
copy
Returns a copy of the SerializationParameters instance.- Parameters:
parameters- the SerializationParameters instance to copy- Returns:
- a copy of the SerializationParameters instance
-