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, for use by the
format-number() function.
In XSLT, there is a single set of decimal formats shared by the whole stylesheet. In XQuery 1.1, however, each query module has its own set of decimal formats. The DecimalFormatManager to use is therefore linked from the format-number() call on the expression tree.
- Author:
- Michael H. Kay
- See Also:
-
Field Summary
Fields -
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.Get a named decimal-format registered using setNamedDecimalFormatGet a named decimal-format registered using setNamedDecimalFormat or create one if does not existvoid
setDefaultDecimalFormat
(DecimalSymbols dfs, int precedence) Register the default decimal-format.void
setNamedDecimalFormat
(StructuredQName qName, DecimalSymbols dfs, int precedence) Set a named decimal format.
-
Field Details
-
DEFAULT_NAME
-
-
Constructor Details
-
DecimalFormatManager
public DecimalFormatManager()create a DecimalFormatManager and initialise variables
-
-
Method Details
-
setDefaultDecimalFormat
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
Method called at the end of stylesheet compilation to fix up any format-number() calls to the "default default" decimal format- Throws:
XPathException
-
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 the 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
-
getNamedDecimalFormat
Get a named decimal-format registered using setNamedDecimalFormat- Parameters:
qName
- The name of the decimal format- Returns:
- the DecimalSymbols object corresponding to the given name, if any or null if not set.
-
obtainNamedDecimalFormat
Get a named decimal-format registered using setNamedDecimalFormat or create one if does not exist- Parameters:
qName
- The name of the decimal format- Returns:
- the DecimalSymbols object corresponding to the given name.
- Throws:
XPathException
-