net.sf.saxon.expr

Class CollationMap

Implemented Interfaces:
Serializable

public class CollationMap
extends java.lang.Object
implements 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.

Constructor Summary

CollationMap(Configuration config)
Create a collation map
CollationMap(CollationMap in)
Create a copy of a collation map

Method Summary

StringCollator
getDefaultCollation()
Get the default collation
String
getDefaultCollationName()
Get the name of the default collation
StringCollator
getNamedCollation(String name)
Get the collation with a given collation name.
void
setDefaultCollationName(String name)
Set the name of the default collation
void
setNamedCollation(String absoluteURI, StringCollator collator)
Register a named collation

Constructor Details

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 Details

getDefaultCollation

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

getDefaultCollationName

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

getNamedCollation

public StringCollator getNamedCollation(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

setDefaultCollationName

public void setDefaultCollationName(String name)
Set the name of the default collation
Parameters:
name - the default collation name (should be a URI, but this is not enforced)

setNamedCollation

public void setNamedCollation(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