Class SerializationProperties


  • public class SerializationProperties
    extends java.lang.Object
    Define a set of serialization properties. These may contain simple output properties such as method or indent, Saxon extensions such as saxon:indent-spaces, and may also contain an index of character maps.
    • 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 the USE_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 classes OutputKeys and SaxonOutputKeys).
        value - the property value. In the case of QName-valued properties, such as cdata-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 classes OutputKeys and SaxonOutputKeys).
        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, the xsl: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 a Receiver pipeline
      • getValidationFactory

        public FilterFactory getValidationFactory()
        Get any validation factory that was added to the serialization parameters using setValidationFactory(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 for xsl:result-document.
        Parameters:
        next - the next Receiver in the pipeline
        Returns:
        the new SequenceNormalizer, feeding into the supplied Receiver, 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 class java.lang.Object