Class CollationMap

  • All Implemented Interfaces:
    java.io.Serializable

    public class CollationMap
    extends java.lang.Object
    implements java.io.Serializable
    This object maps collation URIs to collations. Logically this function is part of the static context, but it is often needed dynamically, so it is defined as a separate component that can safely be retained at run-time.
    See Also:
    Serialized Form
    • Constructor Detail

      • CollationMap

        public CollationMap​(Configuration config)
        Create a collation map
        Parameters:
        config - the Saxon configuration
      • CollationMap

        public CollationMap​(CollationMap in)
        Create a copy of a collation map
        Parameters:
        in - the collation map to be copied
    • Method Detail

      • setDefaultCollationName

        public void setDefaultCollationName​(java.lang.String name)
        Set the name of the default collation
        Parameters:
        name - the default collation name (should be a URI, but this is not enforced)
        Throws:
        java.lang.NullPointerException - if the supplied name is null
      • getDefaultCollationName

        public java.lang.String getDefaultCollationName()
        Get the name of the default collation
        Returns:
        the default collation name (should be a URI, but this is not enforced)
      • getDefaultCollation

        public StringCollator getDefaultCollation()
        Get the default collation
        Returns:
        the default collation, as a StringCollator
      • setNamedCollation

        public void setNamedCollation​(java.lang.String absoluteURI,
                                      StringCollator collator)
        Register a named collation
        Parameters:
        absoluteURI - the name of the collation. This should be an absolute URI, but this is not enforced
        collator - the StringCollator that implements the collating rules
      • getNamedCollation

        public StringCollator getNamedCollation​(java.lang.String name)
        Get the collation with a given collation name. If the collation name has not been registered in this CollationMap, the CollationURIResolver registered with the Configuration is called. If this cannot resolve the collation name, it should return null.
        Parameters:
        name - the collation name (should be an absolute URI)
        Returns:
        the StringCollator with this name if known, or null if not known