Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.xalan.xslt
Class NumeratorFormatter  view NumeratorFormatter download NumeratorFormatter.java

java.lang.Object
  extended byorg.apache.xalan.xslt.NumeratorFormatter

class NumeratorFormatter
extends java.lang.Object

Converts enumerated numbers into strings, using the XSL conversion attributes. Having this in a class helps avoid being forced to extract the attributes repeatedly.


Nested Class Summary
(package private)  class NumeratorFormatter.NumberFormatStringTokenizer
          This class returns tokens using non-alphanumberic characters as delimiters.
 
Field Summary
private static char[] m_alphaCountTable
          Chars for converting integers into alpha counts.
(package private)  java.text.NumberFormat m_formatter
           
(package private)  NumeratorFormatter.NumberFormatStringTokenizer m_formatTokenizer
           
(package private)  java.util.Locale m_locale
           
(package private)  XSLTEngineImpl m_processor
           
private static DecimalToRoman[] m_romanConvertTable
          Table to help in converting decimals to roman numerals.
protected  org.w3c.dom.Element m_xslNumberElement
           
 
Constructor Summary
(package private) NumeratorFormatter(org.w3c.dom.Element xslNumberElement, XSLTEngineImpl processor)
          Construct a NumeratorFormatter using an element that contains XSL number conversion attributes - format, letter-value, xml:lang, digit-group-sep, n-digits-per-group, and sequence-src.
 
Method Summary
protected  java.lang.String int2alphaCount(int val, char[] table)
          Convert a long integer into alphabetic counting, in other words count using the sequence A B C ...
(package private)  java.lang.String long2roman(long val, boolean prefixesAreOK)
          Convert a long integer into roman numerals.
(package private)  void processAttributes(org.w3c.dom.Node contextNode)
          Process the attributes of the node with number formatting attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_xslNumberElement

protected org.w3c.dom.Element m_xslNumberElement

m_formatTokenizer

NumeratorFormatter.NumberFormatStringTokenizer m_formatTokenizer

m_locale

java.util.Locale m_locale

m_formatter

java.text.NumberFormat m_formatter

m_processor

XSLTEngineImpl m_processor

m_romanConvertTable

private static final DecimalToRoman[] m_romanConvertTable
Table to help in converting decimals to roman numerals.

See Also:
XSLTEngineImpl#DecimalToRoman, XSLTEngineImpl#long2roman

m_alphaCountTable

private static final char[] m_alphaCountTable
Chars for converting integers into alpha counts.

See Also:
XSLTEngineImpl#int2alphaCount
Constructor Detail

NumeratorFormatter

NumeratorFormatter(org.w3c.dom.Element xslNumberElement,
                   XSLTEngineImpl processor)
Construct a NumeratorFormatter using an element that contains XSL number conversion attributes - format, letter-value, xml:lang, digit-group-sep, n-digits-per-group, and sequence-src.

Method Detail

processAttributes

void processAttributes(org.w3c.dom.Node contextNode)
                 throws XSLProcessorException,
                        java.net.MalformedURLException,
                        java.io.FileNotFoundException,
                        java.io.IOException
Process the attributes of the node with number formatting attributes. I'd like to do this at construction time, but I have to do it every time because the elements may have attribute templates embedded in them, and so must be processed only when the node is actually called. TODO: Can I just do NumeratorFormatter.processAttributes up front now?


int2alphaCount

protected java.lang.String int2alphaCount(int val,
                                          char[] table)
Convert a long integer into alphabetic counting, in other words count using the sequence A B C ... Z AA AB AC.... etc.


long2roman

java.lang.String long2roman(long val,
                            boolean prefixesAreOK)
Convert a long integer into roman numerals.