Package net.sf.saxon.trans
Class DecimalFormatManager
- java.lang.Object
-
- net.sf.saxon.trans.DecimalFormatManager
-
- All Implemented Interfaces:
java.io.Serializable
public class DecimalFormatManager extends java.lang.Object implements java.io.Serializable
DecimalFormatManager manages the collection of named and unnamed decimal formats- Author:
- Michael H. Kay
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StructuredQName
DEFAULT_NAME
-
Constructor Summary
Constructors Constructor Description DecimalFormatManager()
create a DecimalFormatManager and initialise variables
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fixupDefaultDefault()
Method called at the end of stylesheet compilation to fix up any format-number() calls to the "default default" decimal formatDecimalSymbols
getDefaultDecimalFormat()
Get the default decimal-format.DecimalSymbols
getNamedDecimalFormat(StructuredQName qName)
Get a named decimal-format registered using setNamedDecimalFormatvoid
registerUsage(StructuredQName qName, FormatNumber 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
setDefaults(DecimalSymbols d)
Set up the XSLT-defined default attributes in a DecimalFormatSymbolsvoid
setNamedDecimalFormat(StructuredQName qName, DecimalSymbols dfs, int precedence)
Set a named decimal format.
-
-
-
Field Detail
-
DEFAULT_NAME
public static final StructuredQName DEFAULT_NAME
-
-
Method Detail
-
setDefaults
public static void setDefaults(DecimalSymbols d)
Set up the XSLT-defined default attributes in a DecimalFormatSymbols
-
setDefaultDecimalFormat
public void setDefaultDecimalFormat(DecimalSymbols dfs, int precedence) throws XPathException
Register the default decimal-format. Note that it is an error to register the same decimal-format twice, even with different precedence- Throws:
XPathException
-
fixupDefaultDefault
public void fixupDefaultDefault() throws XPathException
Method called at the end of stylesheet compilation to fix up any format-number() calls to the "default default" decimal format- Throws:
XPathException
-
getDefaultDecimalFormat
public DecimalSymbols getDefaultDecimalFormat()
Get the default decimal-format.
-
setNamedDecimalFormat
public void setNamedDecimalFormat(StructuredQName qName, DecimalSymbols dfs, int precedence) throws XPathException
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:
qName
- the name of the decimal format- Throws:
XPathException
-
registerUsage
public void registerUsage(StructuredQName qName, FormatNumber 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 DecimalSymbols getNamedDecimalFormat(StructuredQName qName)
Get a named decimal-format registered using setNamedDecimalFormat- Parameters:
qName
- The name of the decimal format- Returns:
- the DecimalFormatSymbols object corresponding to the named locale, if any or null if not set.
-
-