Class DecimalFormatManager

java.lang.Object
net.sf.saxon.trans.DecimalFormatManager

public class DecimalFormatManager extends Object
DecimalFormatManager manages the collection of named and unnamed decimal formats, for use by the format-number() function.

In XSLT 2.0, there is a single set of decimal formats shared by the whole stylesheet. In XQuery 3.0, however, each query module has its own set of decimal formats, and in XSLT 3.0 decimal formats are local to a package. The DecimalFormatManager to use is therefore linked from the format-number() call on the expression tree.

  • Constructor Details

    • DecimalFormatManager

      public DecimalFormatManager(HostLanguage language, int languageLevel)
      create a DecimalFormatManager and initialise variables
  • Method Details

    • getDefaultDecimalFormat

      public DecimalSymbols getDefaultDecimalFormat()
      Get the default decimal-format.
      Returns:
      the default (unnamed) decimal format
    • getNamedDecimalFormat

      public DecimalSymbols getNamedDecimalFormat(StructuredQName qName)
      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

      public DecimalSymbols obtainNamedDecimalFormat(StructuredQName qName)
      Get a named decimal-format registered using setNamedDecimalFormat if it exists; create it if it does not
      Parameters:
      qName - The name of the decimal format
      Returns:
      the DecimalSymbols object corresponding to the given name, if it exists, or a newly created DecimalSymbols object otherwise
    • getDecimalFormatNames

      public Iterable<StructuredQName> getDecimalFormatNames()
      Get the names of all named decimal formats that have been registered
      Returns:
      the collection of names
    • checkConsistency

      public void checkConsistency() throws XPathException
      Check the consistency of all DecimalSymbols objects owned by this DecimalFormatManager
      Throws:
      XPathException - if any inconsistencies are found