Package net.sf.saxon.serialize
Class SerializationProperties
- java.lang.Object
-
- net.sf.saxon.serialize.SerializationProperties
-
public class SerializationProperties extends java.lang.Object
Define a set of serialization properties. These may contain simple output properties such asmethod
orindent
, Saxon extensions such assaxon:indent-spaces
, and may also contain an index of character maps.
-
-
Constructor Summary
Constructors Constructor Description SerializationProperties()
Create a set of defaulted serialization parametersSerializationProperties(java.util.Properties props)
Create a set of serialization parameters based on defined output properties, with no character mapsSerializationProperties(java.util.Properties props, CharacterMapIndex charMapIndex)
Create a set of serialization parameters based on defined output properties, with an index of named character maps that may be referred to from theUSE_CHARACTER_MAPS
property
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SerializationProperties
combineWith(SerializationProperties defaults)
Combine these serialization parameters with a set of default serialization parameters to create a new set of serialization parameters.CharacterMapIndex
getCharacterMapIndex()
Get the character map index, if anyjava.util.Properties
getProperties()
Get the simple output properties defined in these serialization parameters.java.lang.String
getProperty(java.lang.String name)
Get the value of a serialization propertyFilterFactory
getValidationFactory()
Get any validation factory that was added to the serialization parameters usingsetValidationFactory(FilterFactory)
SequenceNormalizer
makeSequenceNormalizer(Receiver next)
Convenience method to create an appropriate SequenceNormalizer, based on the item-separator appearing in the serialization parameters.void
setProperty(java.lang.String name, java.lang.String value)
Set the value of a serialization property.void
setValidationFactory(FilterFactory validationFactory)
Although validation is not normally part of serialization, thexsl:result-document
instruction allows a validator to be inserted into the serialization pipeline.java.lang.String
toString()
-
-
-
Constructor Detail
-
SerializationProperties
public SerializationProperties()
Create a set of defaulted serialization parameters
-
SerializationProperties
public SerializationProperties(java.util.Properties props)
Create a set of serialization parameters based on defined output properties, with no character maps
-
SerializationProperties
public SerializationProperties(java.util.Properties props, CharacterMapIndex charMapIndex)
Create a set of serialization parameters based on defined output properties, with an index of named character maps that may be referred to from theUSE_CHARACTER_MAPS
property
-
-
Method Detail
-
setProperty
public void setProperty(java.lang.String name, java.lang.String value)
Set the value of a serialization property.- Parameters:
name
- the property name in Clark notation (if this is constant, the available constants are defined in classesOutputKeys
andSaxonOutputKeys
).value
- the property value. In the case of QName-valued properties, such ascdata-section-elements
, these should be in Clark notation
-
getProperty
public java.lang.String getProperty(java.lang.String name)
Get the value of a serialization property- Parameters:
name
- the property name in Clark notation (if this is constant, the available constants are defined in classesOutputKeys
andSaxonOutputKeys
).- Returns:
- the property value. In the case of QName-valued properties, such as
cdata-section-elements
, these should be in Clark notation
-
getProperties
public java.util.Properties getProperties()
Get the simple output properties defined in these serialization parameters. The property names will be in clark-name format, for example"indent"
or"{http://saxon.sf.net/}indent-spaces"
- Returns:
- the output properties
-
getCharacterMapIndex
public CharacterMapIndex getCharacterMapIndex()
Get the character map index, if any- Returns:
- the character map index, if one is present, otherwise null
-
setValidationFactory
public void setValidationFactory(FilterFactory validationFactory)
Although validation is not normally part of serialization, thexsl:result-document
instruction allows a validator to be inserted into the serialization pipeline. This is achieved by adding a request to insert a validation stage to the serialization parameters. The request is in the form of a factory function that constructs the required validator- Parameters:
validationFactory
- a function that inserts a validator into aReceiver
pipeline
-
getValidationFactory
public FilterFactory getValidationFactory()
Get any validation factory that was added to the serialization parameters usingsetValidationFactory(FilterFactory)
- Returns:
- the validation factory, or null if there is none.
-
makeSequenceNormalizer
public SequenceNormalizer makeSequenceNormalizer(Receiver next)
Convenience method to create an appropriate SequenceNormalizer, based on the item-separator appearing in the serialization parameters. If the serialization parameters include a request for validation, then a validator will also be inserted into the pipeline immediately after the SequenceNormalizer, as required by the rules forxsl:result-document
.- Parameters:
next
- the nextReceiver in the pipeline
- Returns:
- the new
SequenceNormalizer
, feeding into the suppliedReceiver
, possibly via a new validating filter.
-
combineWith
public SerializationProperties combineWith(SerializationProperties defaults)
Combine these serialization parameters with a set of default serialization parameters to create a new set of serialization parameters. Neither of the input parameter sets is modified- Parameters:
defaults
- the parameters to use when no explicit values are supplied
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-