net.sf.saxon.trans
Class DecimalFormatManager

java.lang.Object
  extended bynet.sf.saxon.trans.DecimalFormatManager
All Implemented Interfaces:
Serializable

public class DecimalFormatManager
extends Object
implements Serializable

DecimalFormatManager manages the collection of named and unnamed decimal formats

Author:
Michael H. Kay (michael.h.kay@ntlworld.com)
See Also:
Serialized Form

Constructor Summary
DecimalFormatManager()
          create a DecimalFormatManager and initialise variables
 
Method Summary
 void fixupDefaultDefault()
          Method called at the end of stylesheet compilation to fix up any format-number() calls to the "default default" decimal format
 DecimalFormatSymbols getDefaultDecimalFormat()
          Get the default decimal-format.
 DecimalFormatSymbols getNamedDecimalFormat(String uri, String localName)
          Get a named decimal-format registered using setNamedDecimalFormat
 void registerUsage(String uri, String localName, FormatNumber2 call)
          Register a format-number() function call that uses a particular decimal format.
 void setDefaultDecimalFormat(DecimalFormatSymbols dfs)
          Register the default decimal-format.
static void setDefaults(DecimalFormatSymbols d)
          Set up the XSLT-defined default attributes in a DecimalFormatSymbols
 void setNamedDecimalFormat(String uri, String localName, DecimalFormatSymbols dfs)
          Set a named decimal format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecimalFormatManager

public DecimalFormatManager()
create a DecimalFormatManager and initialise variables

Method Detail

setDefaults

public static void setDefaults(DecimalFormatSymbols d)
Set up the XSLT-defined default attributes in a DecimalFormatSymbols


setDefaultDecimalFormat

public void setDefaultDecimalFormat(DecimalFormatSymbols dfs)
                             throws TransformerConfigurationException
Register the default decimal-format. Note that it is an error to register the same decimal-format twice, even with different precedence

Throws:
TransformerConfigurationException

fixupDefaultDefault

public void fixupDefaultDefault()
                         throws TransformerConfigurationException
Method called at the end of stylesheet compilation to fix up any format-number() calls to the "default default" decimal format

Throws:
TransformerConfigurationException

getDefaultDecimalFormat

public DecimalFormatSymbols getDefaultDecimalFormat()
Get the default decimal-format.


setNamedDecimalFormat

public void setNamedDecimalFormat(String uri,
                                  String localName,
                                  DecimalFormatSymbols dfs)
                           throws TransformerConfigurationException
Set a named decimal format. Note that it is an error to register the same decimal-format twice, even with different precedence, unless the values are equal

Parameters:
uri - The URI of the name of the decimal format
localName - The local part of the name of the decimal format
Throws:
TransformerConfigurationException

registerUsage

public void registerUsage(String uri,
                          String localName,
                          FormatNumber2 call)
Register a format-number() function call that uses a particular decimal format. This allows early compile time resolution to a DecimalFormatSymbols object where possible, even in the case of a forwards reference


getNamedDecimalFormat

public DecimalFormatSymbols getNamedDecimalFormat(String uri,
                                                  String localName)
Get a named decimal-format registered using setNamedDecimalFormat

Parameters:
uri - The URI of the name of the decimal format
localName - The local part of the name of the decimal format
Returns:
the DecimalFormatSymbols object corresponding to the named locale, if any or null if not set.