APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.dom

public Class SimpleResultTreeImpl

extends EmptySerializer
implements DOM, DTM
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xml.internal.dtm.DTM, com.sun.org.apache.xalan.internal.xsltc.DOM
Known Direct Subclasses
com.sun.org.apache.xalan.internal.xsltc.dom.AdaptiveResultTreeImpl
Imports
com.sun.org.apache.xalan.internal.xsltc.DOM, .StripFilter, .TransletException, com.sun.org.apache.xml.internal.dtm.Axis, .DTM, .DTMAxisIterator, .DTMAxisTraverser, .DTMManager, com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase, .DTMManagerDefault, com.sun.org.apache.xml.internal.serializer.EmptySerializer, .SerializationHandler, com.sun.org.apache.xml.internal.utils.XMLString, .XMLStringDefault, java.util.Map, javax.xml.transform.SourceLocator, org.w3c.dom.Node, .NodeList, org.xml.sax.SAXException

This class represents a light-weight DOM model for simple result tree fragment(RTF). A simple RTF is an RTF that has only one Text node. The Text node can be produced by a combination of Text, xsl:value-of and xsl:number instructions. It can also be produced by a control structure (xsl:if or xsl:choose) whose body is pure Text.

A SimpleResultTreeImpl has only two nodes, i.e. the ROOT node and its Text child. All DOM interfaces are overridden with this in mind. For example, the getStringValue() interface returns the value of the Text node. This class receives the character data from the characters() interface.

This class implements DOM and SerializationHandler. It also implements the DTM interface for support in MultiDOM. The nested iterators (SimpleIterator and SingletonIterator) are used to support the nodeset() extension function.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
SimpleResultTreeImpl.SimpleIterator

The SimpleIterator is designed to support the nodeset() extension function.

public class
SimpleResultTreeImpl.SingletonIterator

The SingletonIterator is used for the self axis.

Field Summary

Modifier and TypeField and Description
private int
private static int
private BitArray
protected XSLTCDTMManager
private boolean
protected int
private String
protected String[]
private static final DTMAxisIterator
private static final String
public static final int
public static final int
public static final int
Inherited from com.sun.org.apache.xml.internal.serializer.EmptySerializer:
ERR

Constructor Summary

AccessConstructor and Description
public
SimpleResultTreeImpl(XSLTCDTMManager dtmManager, int documentID)

Method Summary

Modifier and TypeMethod and Description
public void
appendChild(int newChild, boolean clone, boolean cloneDepth)

Implements com.sun.org.apache.xml.internal.dtm.DTM.appendChild.

Append a child to "the end of the document".

public void
appendTextChild(String str)

Implements com.sun.org.apache.xml.internal.dtm.DTM.appendTextChild.

Append a text node child that will be constructed from a string, to the end of the document.

public void
characters(final int node, SerializationHandler handler)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.characters.

Dispatch the character content of a node to an output handler.

public void
characters(String str)

Overrides com.sun.org.apache.xml.internal.serializer.EmptySerializer.characters.

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.characters.

This method is used to notify of a character event, but passing the data as a character String rather than the standard character array.

public void
characters(char[] ch, int offset, int length)

Overrides com.sun.org.apache.xml.internal.serializer.EmptySerializer.characters.

Implements org.xml.sax.ContentHandler.characters.

Receive notification of character data.

public void
public void
public void
dispatchCharactersEvents(int nodeHandle, ContentHandler ch, boolean normalize)

Implements com.sun.org.apache.xml.internal.dtm.DTM.dispatchCharactersEvents.

Directly call the characters method on the passed ContentHandler for the string-value of the given node (see http://www.w3.org/TR/xpath#data-model for the definition of a node's string-value).

public void
dispatchToEvents(int nodeHandle, ContentHandler ch)

Implements com.sun.org.apache.xml.internal.dtm.DTM.dispatchToEvents.

Directly create SAX parser events representing the XML content of a DTM subtree.

public void
documentRegistration()

Implements com.sun.org.apache.xml.internal.dtm.DTM.documentRegistration.

As the DTM is registered with the DTMManager, this method will be called.

public void
documentRelease()

Implements com.sun.org.apache.xml.internal.dtm.DTM.documentRelease.

As documents are released from the DTMManager, the DTM implementation will be notified of the event.

public void
public int
public int
getAttributeNode(int elementHandle, String namespaceURI, String name)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getAttributeNode.

Retrieves an attribute node by local name and namespace URI %TBD% Note that we currently have no way to support the DOM's old getAttribute() call, which accesses only the qname.

public DTMAxisIterator
getAxisIterator(final int axis)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getAxisIterator, com.sun.org.apache.xml.internal.dtm.DTM.getAxisIterator.

This is a shortcut to the iterators that implement XPath axes.

public DTMAxisTraverser
getAxisTraverser(final int axis)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getAxisTraverser.

This returns a stateless "traverser", that can navigate over an XPath axis, though not in document order.

public DTMAxisIterator
public ContentHandler
getContentHandler()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getContentHandler.

Return this DTM's content handler, if it has one.

public DeclHandler
getDeclHandler()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDeclHandler.

Return this DTM's DeclHandler, if it has one.

public int
getDocument()

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getDocument, com.sun.org.apache.xml.internal.dtm.DTM.getDocument.

Given a DTM which contains only a single document, find the Node Handle of the Document node.

public boolean
getDocumentAllDeclarationsProcessed()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentAllDeclarationsProcessed.

Return an indication of whether the processor has read the complete DTD.

public String
getDocumentBaseURI()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentBaseURI.

Return the base URI of the document entity.

public String
getDocumentEncoding(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentEncoding.

Return the name of the character encoding scheme in which the document entity is expressed.

public int
getDocumentRoot(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentRoot.

Given a node handle, find the owning document node.

public String
getDocumentStandalone(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentStandalone.

Return an indication of the standalone status of the document, either "yes" or "no".

public String
getDocumentSystemIdentifier(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentSystemIdentifier.

Return the system identifier of the document entity.

public String
getDocumentTypeDeclarationPublicIdentifier()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentTypeDeclarationPublicIdentifier.

Return the public identifier of the external subset, normalized as described in 4.2.2 External Entities [XML].

public String
getDocumentTypeDeclarationSystemIdentifier()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentTypeDeclarationSystemIdentifier.

A document type declaration information item has the following properties: 1.

public String
public String
getDocumentVersion(int documentHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentVersion.

Return a string representing the XML version of the document.

public DTDHandler
getDTDHandler()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDTDHandler.

Return this DTM's DTDHandler, if it has one.

public DTMManagerDefault
public int
getElementById(String elementId)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getElementById.

Returns the Element whose ID is given by elementId.

public Map<String, Integer>
public EntityResolver
getEntityResolver()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getEntityResolver.

Return this DTM's EntityResolver, if it has one.

public ErrorHandler
getErrorHandler()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getErrorHandler.

Return this DTM's ErrorHandler, if it has one.

public int
getExpandedTypeID(final int nodeHandle)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getExpandedTypeID, com.sun.org.apache.xml.internal.dtm.DTM.getExpandedTypeID.

Given a node handle, return an ID that represents the node's expanded name.

public int
getExpandedTypeID(String namespace, String localName, int type)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getExpandedTypeID.

Given an expanded name, return an ID. If the expanded-name does not exist in the internal tables, the entry will be created, and the ID will be returned.

public int
getFirstAttribute(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getFirstAttribute.

Given a node handle, get the index of the node's first attribute.

public int
getFirstChild(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getFirstChild.

Given a node handle, get the handle of the node's first child.

public int
getFirstNamespaceNode(int nodeHandle, boolean inScope)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getFirstNamespaceNode.

Given a node handle, get the index of the node's first namespace node.

public DTMAxisIterator
getIterator()

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getIterator.

returns singleton iterator containg the document root

public String
public int
getLastChild(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getLastChild.

Given a node handle, get the handle of the node's last child.

public short
getLevel(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getLevel.

Get the depth level of this node in the tree (equals 1 for a parentless node).

public LexicalHandler
getLexicalHandler()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getLexicalHandler.

Return this DTM's lexical handler, if it has one.

public String
getLocalName(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getLocalName.

Given a node handle, return its DOM-style localname.

public String
getLocalNameFromExpandedNameID(int ExpandedNameID)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getLocalNameFromExpandedNameID.

Given an expanded-name ID, return the local name part.

public DTMAxisIterator
public String
getNamespaceFromExpandedNameID(int ExpandedNameID)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNamespaceFromExpandedNameID.

Given an expanded-name ID, return the namespace URI part.

public String
public int
public String
getNamespaceURI(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNamespaceURI.

Given a node handle, return its DOM-style namespace URI (As defined in Namespaces, this is the declared URI which this node's prefix -- or default in lieu thereof -- was mapped to.)

public int
getNextAttribute(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNextAttribute.

Given a node handle, advance to the next attribute.

public int
getNextNamespaceNode(int baseHandle, int namespaceHandle, boolean inScope)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNextNamespaceNode.

Given a namespace handle, advance to the next namespace in the same scope (local or local-plus-inherited, as selected by getFirstNamespaceNode)

public int
getNextSibling(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNextSibling.

Given a node handle, advance to its next sibling.

public Node
getNode(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNode.

Return an DOM node for the given node.

public int
getNodeHandle(final int nodeId)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getNodeHandle.

Return the node handle from a node identity.

public int
getNodeIdent(final int nodehandle)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getNodeIdent.

Return the node identity from a node handle.

public String
getNodeName(final int node)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getNodeName, com.sun.org.apache.xml.internal.dtm.DTM.getNodeName.

Given a node handle, return its DOM-style node name.

public String
getNodeNameX(final int node)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getNodeNameX, com.sun.org.apache.xml.internal.dtm.DTM.getNodeNameX.

Given a node handle, return the XPath node name.

public short
getNodeType(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNodeType.

Given a node handle, return its DOM-style node type.

public String
getNodeValue(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNodeValue.

Given a node handle, return its node value.

public DTMAxisIterator
public int
public DTMAxisIterator
getNthDescendant(int node, int n, boolean includeself)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getNthDescendant.

public SerializationHandler
public int
getOwnerDocument(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getOwnerDocument.

Given a node handle, find the owning document node.

public int
getParent(final int nodeHandle)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getParent, com.sun.org.apache.xml.internal.dtm.DTM.getParent.

Given a node handle, find its parent node.

public String
getPrefix(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getPrefix.

Given a namespace handle, return the prefix that the namespace decl is mapping.

public int
getPreviousSibling(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getPreviousSibling.

Given a node handle, find its preceeding sibling.

public DOM
public DOM
getResultTreeFrag(int initialSize, int rtfType, boolean addToManager)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getResultTreeFrag.

public int
public SourceLocator
getSourceLocatorFor(int node)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getSourceLocatorFor.

Get the location of a node in the source document.

public String
public XMLString
getStringValue(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getStringValue.

Get the string-value of a node as a String object (see http://www.w3.org/TR/xpath#data-model for the definition of a node's string-value).

public char[]
getStringValueChunk(int nodeHandle, int chunkIndex, int[] startAndLen)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getStringValueChunk.

Get a character array chunk in the string-value of a node.

public int
getStringValueChunkCount(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getStringValueChunkCount.

Get number of character array chunks in the string-value of a node.

public String
public DTMAxisIterator
getTypedAxisIterator(final int axis, final int type)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getTypedAxisIterator, com.sun.org.apache.xml.internal.dtm.DTM.getTypedAxisIterator.

Get an iterator that can navigate over an XPath Axis, predicated by the extended type ID.

public DTMAxisIterator
public String
getUnparsedEntityURI(String name)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getUnparsedEntityURI, com.sun.org.apache.xml.internal.dtm.DTM.getUnparsedEntityURI.

The getUnparsedEntityURI function returns the URI of the unparsed entity with the specified name in the same document as the context node (see [3.3 Unparsed Entities]).

public boolean
hasChildNodes(int nodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.hasChildNodes.

Given a node handle, test if it has child nodes.

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
isNodeAfter(int firstNodeHandle, int secondNodeHandle)

Implements com.sun.org.apache.xml.internal.dtm.DTM.isNodeAfter.

Figure out whether nodeHandle2 should be considered as being later in the document than nodeHandle1, in Document Order as defined by the XPath model.

public boolean
isSupported(String feature, String version)

Implements com.sun.org.apache.xml.internal.dtm.DTM.isSupported.

Tests whether DTM DOM implementation implements a specific feature and that feature is supported by this node.

public boolean
lessThan(final int node1, final int node2)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.lessThan.

public String
public Node
public Node
public NodeList
public NodeList
public void
migrateTo(DTMManager manager)

Implements com.sun.org.apache.xml.internal.dtm.DTM.migrateTo.

Migrate a DTM built with an old DTMManager to a new DTMManager.

public boolean
public DTMAxisIterator
public void
public void
setDocumentBaseURI(String baseURI)

Implements com.sun.org.apache.xml.internal.dtm.DTM.setDocumentBaseURI.

Set the base URI of the document entity.

public boolean
public void
setFeature(String featureId, boolean state)

Implements com.sun.org.apache.xml.internal.dtm.DTM.setFeature.

The DTM interfaces are not used in this class.

public void
public void
setProperty(String property, Object value)

Implements com.sun.org.apache.xml.internal.dtm.DTM.setProperty.

Set a run time property for this DTM instance.

public void
setupMapping(String[] names, String[] uris, int[] types, String[] namespaces)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.setupMapping.

public String
public void
startDocument()

Overrides com.sun.org.apache.xml.internal.serializer.EmptySerializer.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

We only need to override the endDocument, characters, and setEscaping interfaces.

public boolean
supportsPreStripping()

Implements com.sun.org.apache.xml.internal.dtm.DTM.supportsPreStripping.

Return true if the xsl:strip-space or xsl:preserve-space was processed during construction of the document contained in this DTM.

Inherited from com.sun.org.apache.xml.internal.serializer.EmptySerializer:
addAttributeaddAttributeaddAttributeaddAttributesaddUniqueAttributeaddXSLAttributeasContentHandlerasDOM3SerializerasDOMSerializerattributeDeclcharactersclosecommentcommentcouldThrowIOExceptioncouldThrowSAXExceptioncouldThrowSAXExceptioncouldThrowSAXExceptionelementDeclendCDATAendDTDendElementendElementendEntityendPrefixMappingentityReferenceerrorexternalEntityDeclfatalErrorflushPendinggetDoctypePublicgetDoctypeSystemgetEncodinggetIndentgetIndentAmountgetMediaTypegetNamespaceMappingsgetNamespaceURIgetNamespaceURIFromPrefixgetOmitXMLDeclarationgetOutputFormatgetOutputPropertygetOutputPropertyDefaultgetOutputStreamgetPrefixgetStandalonegetTransformergetVersiongetWriterignorableWhitespaceinternalEntityDeclnamespaceAfterStartElementnotationDeclprocessingInstructionresetserializesetCdataSectionElementssetContentHandlersetDoctypesetDoctypePublicsetDoctypeSystemsetDocumentLocatorsetDTDEntityExpansionsetEncodingsetIndentsetIndentAmountsetIsStandalonesetMediaTypesetNamespaceMappingssetOmitXMLDeclarationsetOutputFormatsetOutputPropertysetOutputPropertyDefaultsetOutputStreamsetSourceLocatorsetStandalonesetTransformersetVersionsetWriterskippedEntitystartCDATAstartDTDstartElementstartElementstartElementstartEntitystartPrefixMappingstartPrefixMappingunparsedEntityDeclwarning