APIdia Launch Partner
Top Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.runtime

public abstract Class AbstractTranslet

extends Object
implements Translet
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xalan.internal.xsltc.Translet
Imports
com.sun.org.apache.xalan.internal.xsltc.DOM, .DOMCache, .DOMEnhancedForDTM, .Translet, .TransletException, com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter, .KeyIndex, com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory, com.sun.org.apache.xml.internal.dtm.DTM, .DTMAxisIterator, com.sun.org.apache.xml.internal.serializer.SerializationHandler, java.io.BufferedOutputStream, .File, .FileOutputStream, java.text.DecimalFormat, .DecimalFormatSymbols, java.util.ArrayList, .HashMap, .List, .Map, javax.xml.parsers.DocumentBuilderFactory, .ParserConfigurationException, javax.xml.transform.Templates, jdk.xml.internal.JdkConstants, .JdkXmlUtils, org.w3c.dom.DOMImplementation, .Document

Authors
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen, G. Todd Miller, John Howard, [email protected]

Field Summary

Modifier and TypeField and Description
private String
private String
_accessExternalStylesheet

protocols allowed for external references set by the stylesheet processing instruction, Document() function, Import and Include element.

private Map<String, Class<?>>
public List<String>
private int
public String
public String
private DOMCache
_domCache

DOM cache handling

protected DOMImplementation
_domImplementation

DOMImplementation caching for basis library

private KeyIndex
public String
public Map<String, DecimalFormat>
_formatSymbols

Decimal number format symbol handling

protected boolean
public boolean
public int
private int
public boolean
private Map<String, KeyIndex>
_keyIndexes

Index(es) for <xsl:key> / key() / id()

public String
public String
private MessageHandler
_msgHandler

Message handling - implementation of <xsl:message>

public boolean
private boolean
public String
protected Templates
public String
public static final int
private static final String
public static final int
private static final String
protected String[]
protected String[]
private FileOutputStream
protected List<Object>
protected int
pbase

Parameter handling

protected int
pframe

Parameter handling

protected StringValueHandler
protected int
protected int[]
protected String[]
public static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
addCdataElement(String name)

Add's a name of an element whose text contents should be output as CDATA

public void
addDecimalFormat(String name, DecimalFormatSymbols symbols)

Adds a DecimalFormat object to the _formatSymbols map.

public final Object
addParameter(String name, Object value)

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.addParameter.

Add a new global parameter if not already in the current frame.

public final Object
addParameter(String name, Object value, boolean isDefault)

Add a new global or local parameter if not already in the current frame.

private final void
buildIDIndex(DOM document)

Leverages the Key Class to implement the XSLT id() function.

public void
buildKeyIndex(String
is the name of the index (the key or ##id)
name
,
int
is the node handle of the node to insert
node
,
String
is the value that will look up the node in the given index
value
)

Adds a value to a key/id index

public void
buildKeyIndex(String
is the name of the index (the key or ##id)
name
,
DOM
is the DOM
dom
)

Create an empty KeyIndex in the DOM case

private KeyIndex

Returns:

a KeyIndex.
buildKeyIndexHelper
(String
the name of the index (the key or ##id)
name
)

Return KeyIndex for the buildKeyIndex methods.

public void
buildKeys(DOM document, DTMAxisIterator iterator, SerializationHandler handler, int root)

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.buildKeys.

This method builds key indexes - it is overridden in the compiled translet in cases where the <xsl:key> element is used

public final void
characters(final String string, SerializationHandler handler)

Used by some compiled code as a shortcut for passing strings to the output handler

public void
clearParameters()

Clears the parameter stack.

public void
public KeyIndex
createKeyIndex()

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

public final void
displayMessage(String msg)

Pass a message to the message handler - used by Message class.

public String
getAccessError()

Returns the access error.

public String
getAllowedProtocols()

Return allowed protocols for accessing external stylesheet.

public Class<?>
public final DecimalFormat
getDecimalFormat(String name)

Retrieves a named DecimalFormat object from the _formatSymbols map.

public DOMCache
getDOMCache()

Returns the DOM cache used for this translet.

public KeyIndex

Returns:

a KeyIndex.
getKeyIndex
(String
the name of the index (the key or ##id)
name
)

Returns the index for a given key (or id).

public String[]
public String[]
public final Object
getParameter(String name)

Get the value of a parameter from the current frame or null if undefined.

public Templates
public int[]
public String[]
public boolean
public final DOMAdapter
makeDOMAdapter(DOM dom)

Wrap the initial input DOM in a dom adapter.

public Document
public SerializationHandler
openOutputHandler(String filename, boolean append)

Multiple output document extension.

public SerializationHandler
public boolean
overrideDefaultParser()

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.overrideDefaultParser.

Return the state of the services mechanism feature.

public final void
popParamFrame()

Pop the topmost parameter frame.

public final void
postInitialization()

After constructing the translet object, this method must be called to perform any version-specific post-initialization that's required.

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.

public void
printInternalState()

Debugging

public final void
pushParamFrame()

Push a new parameter frame.

public void
setAccessError(String accessErr)

Sets the access error.

public void
setAllowedProtocols(String protocols)

Set allowed protocols for accessing external stylesheet.

public void
public void
setDOMCache(DOMCache cache)

Sets the DOM cache used for additional documents loaded using the document() function.

public void
setIndexSize(int size)

This method is used to pass the largest DOM size to the translet.

public void
setKeyIndexDom(String name, DOM document)

This method builds key indexes - it is overridden in the compiled translet in cases where the <xsl:key> element is used

public final void
setMessageHandler(MessageHandler handler)

Set the translet's message handler - must implement MessageHandler

public void
setOverrideDefaultParser(boolean flag)

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.setOverrideDefaultParser.

Set the state of the services mechanism feature.

private void
setRootForKeys(int root)

public void
protected void
transferOutputSettings(SerializationHandler handler)

Transfer the output settings to the output post-processor

public abstract void
transform(DOM document, DTMAxisIterator iterator, SerializationHandler handler)

Redeclares com.sun.org.apache.xalan.internal.xsltc.Translet.transform.

Main transform() method - this is overridden by the compiled translet

public final void
transform(DOM document, SerializationHandler handler)

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.transform.

Calls transform() with a given output handler

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_accessErrback to summary
private String _accessErr
_accessExternalStylesheetback to summary
private String _accessExternalStylesheet

protocols allowed for external references set by the stylesheet processing instruction, Document() function, Import and Include element.

_auxClassesback to summary
private Map<String, Class<?>> _auxClasses
_cdataback to summary
public List<String> _cdata
_currentRootForKeysback to summary
private int _currentRootForKeys
_doctypePublicback to summary
public String _doctypePublic
_doctypeSystemback to summary
public String _doctypeSystem
_domCacheback to summary
private DOMCache _domCache

DOM cache handling

_domImplementationback to summary
protected DOMImplementation _domImplementation

DOMImplementation caching for basis library

_emptyKeyIndexback to summary
private KeyIndex _emptyKeyIndex
_encodingback to summary
public String _encoding
_formatSymbolsback to summary
public Map<String, DecimalFormat> _formatSymbols

Decimal number format symbol handling

_hasIdCallback to summary
protected boolean _hasIdCall
_indentback to summary
public boolean _indent
_indentamountback to summary
public int _indentamount
_indexSizeback to summary
private int _indexSize
_isStandaloneback to summary
public boolean _isStandalone
_keyIndexesback to summary
private Map<String, KeyIndex> _keyIndexes

Index(es) for <xsl:key> / key() / id()

_mediaTypeback to summary
public String _mediaType
_methodback to summary
public String _method
_msgHandlerback to summary
private MessageHandler _msgHandler

Message handling - implementation of <xsl:message>

_omitHeaderback to summary
public boolean _omitHeader
_overrideDefaultParserback to summary
private boolean _overrideDefaultParser
_standaloneback to summary
public String _standalone
_templatesback to summary
protected Templates _templates
_versionback to summary
public String _version
CURRENT_TRANSLET_VERSIONback to summary
public static final int CURRENT_TRANSLET_VERSION
EMPTYSTRINGback to summary
private static final String EMPTYSTRING
FIRST_TRANSLET_VERSIONback to summary
public static final int FIRST_TRANSLET_VERSION
ID_INDEX_NAMEback to summary
private static final String ID_INDEX_NAME
namesArrayback to summary
protected String[] namesArray
namespaceArrayback to summary
protected String[] namespaceArray
outputback to summary
private FileOutputStream output
paramsStackback to summary
protected List<Object> paramsStack
pbaseback to summary
protected int pbase

Parameter handling

pframeback to summary
protected int pframe

Parameter handling

stringValueHandlerback to summary
protected StringValueHandler stringValueHandler
transletVersionback to summary
protected int transletVersion
typesArrayback to summary
protected int[] typesArray
urisArrayback to summary
protected String[] urisArray
VER_SPLIT_NAMES_ARRAYback to summary
public static final int VER_SPLIT_NAMES_ARRAY

Constructor Detail

AbstractTransletback to summary
public AbstractTranslet()

Method Detail

addAuxiliaryClassback to summary
public void addAuxiliaryClass(Class<?> auxClass)

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.addAuxiliaryClass.

addCdataElementback to summary
public void addCdataElement(String name)

Add's a name of an element whose text contents should be output as CDATA

addDecimalFormatback to summary
public void addDecimalFormat(String name, DecimalFormatSymbols symbols)

Adds a DecimalFormat object to the _formatSymbols map. The entry is created with the input DecimalFormatSymbols.

addParameterback to summary
public final Object addParameter(String name, Object value)

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.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

addParameterback to summary
public final Object addParameter(String name, 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 <xsl:parameter> element's select attribute or element body.

buildIDIndexback to summary
private final void buildIDIndex(DOM document)

Leverages the Key Class to implement the XSLT id() function. buildIdIndex creates the index (##id) that Key Class uses. The index contains the element node index (int) and Id value (String).

buildKeyIndexback to summary
public void buildKeyIndex(String name, int node, String value)

Adds a value to a key/id index

Parameters
name:String

is the name of the index (the key or ##id)

node:int

is the node handle of the node to insert

value:String

is the value that will look up the node in the given index

buildKeyIndexback to summary
public void buildKeyIndex(String name, DOM dom)

Create an empty KeyIndex in the DOM case

Parameters
name:String

is the name of the index (the key or ##id)

dom:DOM

is the DOM

buildKeyIndexHelperback to summary
private KeyIndex buildKeyIndexHelper(String name)

Return KeyIndex for the buildKeyIndex methods. Note the difference from the public getKeyIndex method, this method creates a new Map if keyIndexes does not exist.

Parameters
name:String

the name of the index (the key or ##id)

Returns:KeyIndex

a KeyIndex.

buildKeysback to summary
public void buildKeys(DOM document, DTMAxisIterator iterator, SerializationHandler handler, int root) throws TransletException

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.buildKeys.

This method builds key indexes - it is overridden in the compiled translet in cases where the <xsl:key> element is used

charactersback to summary
public final void characters(final String string, SerializationHandler handler) throws TransletException

Used by some compiled code as a shortcut for passing strings to the output handler

clearParametersback to summary
public void clearParameters()

Clears the parameter stack.

closeOutputHandlerback to summary
public void closeOutputHandler(SerializationHandler handler)
createKeyIndexback to summary
public KeyIndex createKeyIndex()

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

displayMessageback to summary
public final void displayMessage(String msg)

Pass a message to the message handler - used by Message class.

getAccessErrorback to summary
public String getAccessError()

Returns the access error.

getAllowedProtocolsback to summary
public String getAllowedProtocols()

Return allowed protocols for accessing external stylesheet.

getAuxiliaryClassback to summary
public Class<?> getAuxiliaryClass(String className)

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.getAuxiliaryClass.

getDecimalFormatback to summary
public final DecimalFormat getDecimalFormat(String name)

Retrieves a named DecimalFormat object from the _formatSymbols map.

getDOMCacheback to summary
public DOMCache getDOMCache()

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

getKeyIndexback to summary
public KeyIndex getKeyIndex(String name)

Returns the index for a given key (or id). The index implements our internal iterator interface

Parameters
name:String

the name of the index (the key or ##id)

Returns:KeyIndex

a KeyIndex.

getNamesArrayback to summary
public String[] getNamesArray()

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.getNamesArray.

getNamespaceArrayback to summary
public String[] getNamespaceArray()

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.getNamespaceArray.

getParameterback to summary
public final Object getParameter(String name)

Get the value of a parameter from the current frame or null if undefined.

getTemplatesback to summary
public Templates getTemplates()
getTypesArrayback to summary
public int[] getTypesArray()

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.getTypesArray.

getUrisArrayback to summary
public String[] getUrisArray()

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.getUrisArray.

hasIdCallback to summary
public boolean hasIdCall()
makeDOMAdapterback to summary
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()).

newDocumentback to summary
public Document newDocument(String uri, String qname) throws ParserConfigurationException
openOutputHandlerback to summary
public SerializationHandler openOutputHandler(String filename, boolean append) throws TransletException

Multiple output document extension. See compiler/TransletOutput for actual implementation.

openOutputHandlerback to summary
public SerializationHandler openOutputHandler(String filename) throws TransletException
overrideDefaultParserback to summary
public boolean overrideDefaultParser()

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.overrideDefaultParser.

Return the state of the services mechanism feature.

popParamFrameback to summary
public final void popParamFrame()

Pop the topmost parameter frame.

postInitializationback to summary
public final void postInitialization()

After constructing the translet object, this method must be called to perform any version-specific post-initialization that's required.

prepassDocumentback to summary
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.

printInternalStateback to summary
public void printInternalState()

Debugging

pushParamFrameback to summary
public final void pushParamFrame()

Push a new parameter frame.

setAccessErrorback to summary
public void setAccessError(String accessErr)

Sets the access error.

setAllowedProtocolsback to summary
public void setAllowedProtocols(String protocols)

Set allowed protocols for accessing external stylesheet.

setAuxiliaryClassesback to summary
public void setAuxiliaryClasses(Map<String, Class<?>> auxClasses)
setDOMCacheback to summary
public void setDOMCache(DOMCache cache)

Sets the DOM cache used for additional documents loaded using the document() function.

setIndexSizeback to summary
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.

setKeyIndexDomback to summary
public void setKeyIndexDom(String name, DOM document)

This method builds key indexes - it is overridden in the compiled translet in cases where the <xsl:key> element is used

setMessageHandlerback to summary
public final void setMessageHandler(MessageHandler handler)

Set the translet's message handler - must implement MessageHandler

setOverrideDefaultParserback to summary
public void setOverrideDefaultParser(boolean flag)

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.setOverrideDefaultParser.

Set the state of the services mechanism feature.

setRootForKeysback to summary
private void setRootForKeys(int root)
setTemplatesback to summary
public void setTemplates(Templates templates)
transferOutputSettingsback to summary
protected void transferOutputSettings(SerializationHandler handler)

Transfer the output settings to the output post-processor

transformback to summary
public abstract void transform(DOM document, DTMAxisIterator iterator, SerializationHandler handler) throws TransletException

Redeclares com.sun.org.apache.xalan.internal.xsltc.Translet.transform.

Main transform() method - this is overridden by the compiled translet

transformback to summary
public final void transform(DOM document, SerializationHandler handler) throws TransletException

Implements com.sun.org.apache.xalan.internal.xsltc.Translet.transform.

Calls transform() with a given output handler