net.sf.saxon.expr
Class CollationMap

java.lang.Object
  extended by net.sf.saxon.expr.CollationMap
All Implemented Interfaces:
Serializable

public class CollationMap
extends 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.

See Also:
Serialized Form

Constructor Summary
CollationMap(CollationMap in)
          Create a copy of a collation map
CollationMap(Configuration config)
          Create 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(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:
NullPointerException - if the supplied name is null

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)

getDefaultCollation

public StringCollator getDefaultCollation()
Get the default collation

Returns:
the default collation, as a StringCollator

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

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


Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.