Package org.apache.xalan.xsltc.runtime
Class AbstractTranslet
java.lang.Object
org.apache.xalan.xsltc.runtime.AbstractTranslet
- All Implemented Interfaces:
Translet
- Author:
- Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen, G. Todd Miller, John Howard, JohnH@schemasoft.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionDecimal number format symbol handlingbooleanintbooleanstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAuxiliaryClass(Class auxClass) voidaddCdataElement(String name) Add's a name of an element whose text contents should be output as CDATAvoidaddDecimalFormat(String name, DecimalFormatSymbols symbols) Adds a DecimalFormat object to the _formatSymbols hashtable.final ObjectaddParameter(String name, Object value) Add a new global parameter if not already in the current frame.final ObjectaddParameter(String name, Object value, boolean isDefault) Add a new global or local parameter if not already in the current frame.voidbuildKeyIndex(String name, int node, Object value) Adds a value to a key/id indexvoidbuildKeyIndex(String name, DOM dom) Create an empty KeyIndex in the DOM casevoidbuildKeys(DOM document, DTMAxisIterator iterator, SerializationHandler handler, int root) This method builds key indexes - it is overridden in the compiled translet in cases where the <xsl:key> element is usedfinal voidcharacters(String string, SerializationHandler handler) Used by some compiled code as a shortcut for passing strings to the output handlervoidClears the parameter stack.voidcloseOutputHandler(SerializationHandler handler) Creates a KeyIndex object of the desired size - don't want to resize!!!final voiddisplayMessage(String msg) Pass a message to the message handler - used by Message class.getAuxiliaryClass(String className) final DecimalFormatgetDecimalFormat(String name) Retrieves a named DecimalFormat object from _formatSymbols hashtable.Returns the DOM cache used for this translet.getKeyIndex(String name) Returns the index for a given key (or id).String[]String[]final ObjectgetParameter(String name) Get the value of a parameter from the current frame or null if undefined.int[]String[]booleanfinal DOMAdaptermakeDOMAdapter(DOM dom) Wrap the initial input DOM in a dom adapter.newDocument(String uri, String qname) openOutputHandler(String filename) openOutputHandler(String filename, boolean append) Multiple output document extension.final voidPop the topmost parameter frame.final voidAfter constructing the translet object, this method must be called to perform any version-specific post-initialization that's required.final voidprepassDocument(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.voidDebuggingfinal voidPush a new parameter frame.voidsetAuxiliaryClasses(Hashtable auxClasses) voidsetDOMCache(DOMCache cache) Sets the DOM cache used for additional documents loaded using the document() function.voidsetIndexSize(int size) This method is used to pass the largest DOM size to the translet.voidsetKeyIndexDom(String name, DOM document) This method builds key indexes - it is overridden in the compiled translet in cases where the <xsl:key> element is usedfinal voidsetMessageHandler(MessageHandler handler) Set the translet's message handler - must implement MessageHandlervoidsetTemplates(Templates templates) abstract voidtransform(DOM document, DTMAxisIterator iterator, SerializationHandler handler) Main transform() method - this is overridden by the compiled transletfinal voidtransform(DOM document, SerializationHandler handler) Calls transform() with a given output handler
-
Field Details
-
_version
-
_method
-
_encoding
-
_omitHeader
public boolean _omitHeader -
_standalone
-
_doctypePublic
-
_doctypeSystem
-
_indent
public boolean _indent -
_mediaType
-
_cdata
-
_indentamount
public int _indentamount -
FIRST_TRANSLET_VERSION
public static final int FIRST_TRANSLET_VERSION- See Also:
-
VER_SPLIT_NAMES_ARRAY
public static final int VER_SPLIT_NAMES_ARRAY- See Also:
-
CURRENT_TRANSLET_VERSION
public static final int CURRENT_TRANSLET_VERSION- See Also:
-
_formatSymbols
Decimal number format symbol handling
-
-
Constructor Details
-
AbstractTranslet
public AbstractTranslet()
-
-
Method Details
-
printInternalState
public void printInternalState()Debugging -
makeDOMAdapter
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()).- Throws:
TransletException
-
pushParamFrame
public final void pushParamFrame()Push a new parameter frame. -
popParamFrame
public final void popParamFrame()Pop the topmost parameter frame. -
addParameter
Add a new global parameter if not already in the current frame. To setParameters of the form {http://foo.bar}xyz This needs to get mapped to an instance variable in the class The mapping created so that the global variables in the generated class become http$colon$$flash$$flash$foo$dot$bar$colon$xyz- Specified by:
addParameterin interfaceTranslet
-
addParameter
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 <xsl:parameter> element's select attribute or element body. -
clearParameters
public void clearParameters()Clears the parameter stack. -
getParameter
Get the value of a parameter from the current frame or null if undefined. -
setMessageHandler
Set the translet's message handler - must implement MessageHandler -
displayMessage
Pass a message to the message handler - used by Message class. -
addDecimalFormat
Adds a DecimalFormat object to the _formatSymbols hashtable. The entry is created with the input DecimalFormatSymbols. -
getDecimalFormat
Retrieves a named DecimalFormat object from _formatSymbols hashtable. -
prepassDocument
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. -
postInitialization
public final void postInitialization()After constructing the translet object, this method must be called to perform any version-specific post-initialization that's required. -
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
Creates a KeyIndex object of the desired size - don't want to resize!!! -
buildKeyIndex
Adds a value to a key/id index- Parameters:
name- is the name of the index (the key or ##id)node- is the node handle of the node to insertvalue- is the value that will look up the node in the given index
-
buildKeyIndex
Create an empty KeyIndex in the DOM case- Parameters:
name- is the name of the index (the key or ##id)dom- is the DOM
-
getKeyIndex
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 <xsl:key> element is used- Specified by:
buildKeysin interfaceTranslet- Throws:
TransletException
-
setKeyIndexDom
This method builds key indexes - it is overridden in the compiled translet in cases where the <xsl:key> element is used -
setDOMCache
Sets the DOM cache used for additional documents loaded using the document() function. -
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(String filename, boolean append) throws TransletException Multiple output document extension. See compiler/TransletOutput for actual implementation.- Throws:
TransletException
-
openOutputHandler
- Throws:
TransletException
-
closeOutputHandler
-
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:
transformin interfaceTranslet- Throws:
TransletException
-
transform
Calls transform() with a given output handler- Specified by:
transformin interfaceTranslet- Throws:
TransletException
-
characters
Used by some compiled code as a shortcut for passing strings to the output handler- Throws:
TransletException
-
addCdataElement
Add's a name of an element whose text contents should be output as CDATA -
addAuxiliaryClass
- Specified by:
addAuxiliaryClassin interfaceTranslet
-
setAuxiliaryClasses
-
getAuxiliaryClass
- Specified by:
getAuxiliaryClassin interfaceTranslet
-
getNamesArray
- Specified by:
getNamesArrayin interfaceTranslet
-
getUrisArray
- Specified by:
getUrisArrayin interfaceTranslet
-
getTypesArray
public int[] getTypesArray()- Specified by:
getTypesArrayin interfaceTranslet
-
getNamespaceArray
- Specified by:
getNamespaceArrayin interfaceTranslet
-
hasIdCall
public boolean hasIdCall() -
getTemplates
-
setTemplates
-
newDocument
- Throws:
ParserConfigurationException
-