Package net.sf.saxon.trans
Class DecimalFormatManager
java.lang.Object
net.sf.saxon.trans.DecimalFormatManager
- All Implemented Interfaces:
Serializable
DecimalFormatManager manages the collection of named and unnamed decimal formats
- Author:
- Michael H. Kay
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptioncreate a DecimalFormatManager and initialise variables -
Method Summary
Modifier and TypeMethodDescriptionvoid
Method called at the end of stylesheet compilation to fix up any format-number() calls to the "default default" decimal formatGet the default decimal-format.getNamedDecimalFormat
(String uri, String localName) Get a named decimal-format registered using setNamedDecimalFormatvoid
registerUsage
(String uri, String localName, FormatNumber2 call) Register a format-number() function call that uses a particular decimal format.void
setDefaultDecimalFormat
(DecimalSymbols dfs, int precedence) Register the default decimal-format.static void
Set up the XSLT-defined default attributes in a DecimalFormatSymbolsvoid
setNamedDecimalFormat
(String uri, String localName, DecimalSymbols dfs, int precedence) Set a named decimal format.
-
Constructor Details
-
DecimalFormatManager
public DecimalFormatManager()create a DecimalFormatManager and initialise variables
-
-
Method Details
-
setDefaults
Set up the XSLT-defined default attributes in a DecimalFormatSymbols -
setDefaultDecimalFormat
Register the default decimal-format. Note that it is an error to register the same decimal-format twice, even with different precedence- Throws:
StaticError
-
fixupDefaultDefault
Method called at the end of stylesheet compilation to fix up any format-number() calls to the "default default" decimal format- Throws:
StaticError
-
getDefaultDecimalFormat
Get the default decimal-format. -
setNamedDecimalFormat
public void setNamedDecimalFormat(String uri, String localName, DecimalSymbols dfs, int precedence) throws StaticError Set a named decimal format. Note that it is an error to register the same decimal-format twice, unless hte values are equal, or unless there is another of higher precedence. This method assumes that decimal-formats are registered in order of decreasing precedence- Parameters:
uri
- The URI of the name of the decimal formatlocalName
- The local part of the name of the decimal format- Throws:
StaticError
-
registerUsage
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
Get a named decimal-format registered using setNamedDecimalFormat- Parameters:
uri
- The URI of the name of the decimal formatlocalName
- 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.
-