org.apache.xalan.xsltc.runtime
Class AbstractTranslet

java.lang.Object
  |
  +--org.apache.xalan.xsltc.runtime.AbstractTranslet

public abstract class AbstractTranslet
extends java.lang.Object
implements Translet


Field Summary
 java.util.Vector _cdata
           
 java.lang.String _doctypePublic
           
 java.lang.String _doctypeSystem
           
 java.lang.String _encoding
           
 Hashtable _formatSymbols
          Decimal number format symbol handling
 boolean _indent
           
 java.lang.String _mediaType
           
 java.lang.String _method
           
 boolean _omitHeader
           
 java.lang.String _standalone
           
 java.lang.String _version
           
 
Constructor Summary
AbstractTranslet()
           
 
Method Summary
 void addAuxiliaryClass(java.lang.Class auxClass)
           
 void addCdataElement(java.lang.String name)
          Add's a name of an element whose text contents should be output as CDATA
 void addDecimalFormat(java.lang.String name, java.text.DecimalFormatSymbols symbols)
          Adds a DecimalFormat object to the _formatSymbols hashtable.
 java.lang.Object addParameter(java.lang.String name, java.lang.Object value)
          Add a new global parameter if not already in the current frame.
 java.lang.Object addParameter(java.lang.String name, java.lang.Object value, boolean isDefault)
          Add a new global or local parameter if not already in the current frame.
 void buildKeyIndex(java.lang.String name, DOM dom)
          Create an empty KeyIndex in the DOM case
 void buildKeyIndex(java.lang.String name, int node, java.lang.Object value)
          Adds a value to a key/id index
 void buildKeys(DOM document, DTMAxisIterator iterator, SerializationHandler handler, int root)
          This method builds key indexes - it is overridden in the compiled translet in cases where the element is used
 void characters(java.lang.String string, SerializationHandler handler)
          Used by some compiled code as a shortcut for passing strings to the output handler
 void clearParameters()
          Clears the parameter stack.
 void closeOutputHandler(SerializationHandler handler)
           
 KeyIndex createKeyIndex()
          Creates a KeyIndex object of the desired size - don't want to resize!!!
 void displayMessage(java.lang.String msg)
          Pass a message to the message handler - used by Message class.
 java.lang.Class getAuxiliaryClass(java.lang.String className)
           
 java.text.DecimalFormat getDecimalFormat(java.lang.String name)
          Retrieves a named DecimalFormat object from _formatSymbols hashtable.
 DOMCache getDOMCache()
          Returns the DOM cache used for this translet.
 KeyIndex getKeyIndex(java.lang.String name)
          Returns the index for a given key (or id).
 java.lang.String[] getNamesArray()
           
 java.lang.String[] getNamespaceArray()
           
 java.lang.Object getParameter(java.lang.String name)
          Get the value of a parameter from the current frame or null if undefined.
 boolean hasIdCall()
           
 DOMAdapter makeDOMAdapter(DOM dom)
          Wrap the initial input DOM in a dom adapter.
 SerializationHandler openOutputHandler(java.lang.String filename)
           
 SerializationHandler openOutputHandler(java.lang.String filename, boolean append)
          Multiple output document extension.
 void popParamFrame()
          Pop the topmost parameter frame.
 void prepassDocument(DOM document)
          Give the translet an opportunity to perform a prepass on the document to extract any information that it can store in an optimized form.
 void printInternalState()
          Debugging
 void pushParamFrame()
          Push a new parameter frame.
 void setDOMCache(DOMCache cache)
          Sets the DOM cache used for additional documents loaded using the document() function.
 void setIndexSize(int size)
          This method is used to pass the largest DOM size to the translet.
 void setKeyIndexDom(java.lang.String name, DOM document)
          This method builds key indexes - it is overridden in the compiled translet in cases where the element is used
 void setMessageHandler(MessageHandler handler)
          Set the translet's message handler - must implement MessageHandler
abstract  void transform(DOM document, DTMAxisIterator iterator, SerializationHandler handler)
          Main transform() method - this is overridden by the compiled translet
 void transform(DOM document, SerializationHandler handler)
          Calls transform() with a given output handler
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_version

public java.lang.String _version

_method

public java.lang.String _method

_encoding

public java.lang.String _encoding

_omitHeader

public boolean _omitHeader

_standalone

public java.lang.String _standalone

_doctypePublic

public java.lang.String _doctypePublic

_doctypeSystem

public java.lang.String _doctypeSystem

_indent

public boolean _indent

_mediaType

public java.lang.String _mediaType

_cdata

public java.util.Vector _cdata

_formatSymbols

public Hashtable _formatSymbols
Decimal number format symbol handling
Constructor Detail

AbstractTranslet

public AbstractTranslet()
Method Detail

printInternalState

public void printInternalState()
Debugging

makeDOMAdapter

public final DOMAdapter makeDOMAdapter(DOM dom)
                                throws TransletException
Wrap the initial input DOM in a dom adapter. This adapter is wrapped in a DOM multiplexer if the document() function is used (handled by compiled code in the translet - see compiler/Stylesheet.compileTransform()).

pushParamFrame

public final void pushParamFrame()
Push a new parameter frame.

popParamFrame

public final void popParamFrame()
Pop the topmost parameter frame.

addParameter

public final java.lang.Object addParameter(java.lang.String name,
                                           java.lang.Object value)
Add a new global parameter if not already in the current frame.
Specified by:
addParameter in interface Translet

addParameter

public final java.lang.Object addParameter(java.lang.String name,
                                           java.lang.Object value,
                                           boolean isDefault)
Add a new global or local parameter if not already in the current frame. The 'isDefault' parameter is set to true if the value passed is the default value from the element's select attribute or element body.

clearParameters

public void clearParameters()
Clears the parameter stack.

getParameter

public final java.lang.Object getParameter(java.lang.String name)
Get the value of a parameter from the current frame or null if undefined.

setMessageHandler

public final void setMessageHandler(MessageHandler handler)
Set the translet's message handler - must implement MessageHandler

displayMessage

public final void displayMessage(java.lang.String msg)
Pass a message to the message handler - used by Message class.

addDecimalFormat

public void addDecimalFormat(java.lang.String name,
                             java.text.DecimalFormatSymbols symbols)
Adds a DecimalFormat object to the _formatSymbols hashtable. The entry is created with the input DecimalFormatSymbols.

getDecimalFormat

public final java.text.DecimalFormat getDecimalFormat(java.lang.String name)
Retrieves a named DecimalFormat object from _formatSymbols hashtable.

prepassDocument

public final void prepassDocument(DOM document)
Give the translet an opportunity to perform a prepass on the document to extract any information that it can store in an optimized form. Currently, it only extracts information about attributes of type ID.

setIndexSize

public void setIndexSize(int size)
This method is used to pass the largest DOM size to the translet. Needed to make sure that the translet can index the whole DOM.

createKeyIndex

public KeyIndex createKeyIndex()
Creates a KeyIndex object of the desired size - don't want to resize!!!

buildKeyIndex

public void buildKeyIndex(java.lang.String name,
                          int node,
                          java.lang.Object value)
Adds a value to a key/id index

buildKeyIndex

public void buildKeyIndex(java.lang.String name,
                          DOM dom)
Create an empty KeyIndex in the DOM case

getKeyIndex

public KeyIndex getKeyIndex(java.lang.String name)
Returns the index for a given key (or id). The index implements our internal iterator interface

buildKeys

public void buildKeys(DOM document,
                      DTMAxisIterator iterator,
                      SerializationHandler handler,
                      int root)
               throws TransletException
This method builds key indexes - it is overridden in the compiled translet in cases where the element is used
Specified by:
buildKeys in interface Translet

setKeyIndexDom

public void setKeyIndexDom(java.lang.String name,
                           DOM document)
This method builds key indexes - it is overridden in the compiled translet in cases where the element is used

setDOMCache

public void setDOMCache(DOMCache cache)
Sets the DOM cache used for additional documents loaded using the document() function.

getDOMCache

public DOMCache getDOMCache()
Returns the DOM cache used for this translet. Used by the LoadDocument class (if present) when the document() function is used.

openOutputHandler

public SerializationHandler openOutputHandler(java.lang.String filename,
                                              boolean append)
                                       throws TransletException
Multiple output document extension. See compiler/TransletOutput for actual implementation.

openOutputHandler

public SerializationHandler openOutputHandler(java.lang.String filename)
                                       throws TransletException

closeOutputHandler

public void closeOutputHandler(SerializationHandler handler)

transform

public abstract void transform(DOM document,
                               DTMAxisIterator iterator,
                               SerializationHandler handler)
                        throws TransletException
Main transform() method - this is overridden by the compiled translet
Specified by:
transform in interface Translet

transform

public final void transform(DOM document,
                            SerializationHandler handler)
                     throws TransletException
Calls transform() with a given output handler
Specified by:
transform in interface Translet

characters

public final void characters(java.lang.String string,
                             SerializationHandler handler)
                      throws TransletException
Used by some compiled code as a shortcut for passing strings to the output handler

addCdataElement

public void addCdataElement(java.lang.String name)
Add's a name of an element whose text contents should be output as CDATA

addAuxiliaryClass

public void addAuxiliaryClass(java.lang.Class auxClass)
Specified by:
addAuxiliaryClass in interface Translet

getAuxiliaryClass

public java.lang.Class getAuxiliaryClass(java.lang.String className)
Specified by:
getAuxiliaryClass in interface Translet

getNamesArray

public java.lang.String[] getNamesArray()
Specified by:
getNamesArray in interface Translet

getNamespaceArray

public java.lang.String[] getNamespaceArray()
Specified by:
getNamespaceArray in interface Translet

hasIdCall

public boolean hasIdCall()


Copyright © 2003 Apache XML Project. All Rights Reserved.