public class ElemTemplateElement extends UnImplNode implements PrefixResolver, Serializable, ExpressionNode, WhitespaceStrippingElementMatcher, XSLTVisitable
Stylesheet
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected int |
m_docOrderNumber
The *relative* document order number of this element.
|
protected boolean |
m_hasVariableDecl
Tell if this element only has one text child, for optimization purposes.
|
protected ElemTemplateElement |
m_parentNode
Parent node.
|
actualEncoding, fDocumentURI
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
ElemTemplateElement()
Construct a template element instance.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(XSLTVisitor visitor)
Accept a visitor and call the appropriate method
for this class.
|
ElemTemplateElement |
appendChild(ElemTemplateElement elem)
Add a child to the child list.
|
Node |
appendChild(Node newChild)
Add a child to the child list.
|
protected void |
callChildVisitors(XSLTVisitor visitor)
Call the children visitors.
|
protected void |
callChildVisitors(XSLTVisitor visitor,
boolean callAttributes)
Call the children visitors.
|
void |
callVisitors(XSLTVisitor visitor)
This will traverse the heararchy, calling the visitor for
each member.
|
boolean |
canAcceptVariables()
Tell if this element can accept variable declarations.
|
boolean |
canStripWhiteSpace()
Get information about whether or not whitespace can be stripped.
|
int |
compareTo(Object o)
Compares this object with the specified object for precedence order.
|
void |
compose(StylesheetRoot sroot)
This function is called after everything else has been
recomposed, and allows the template to set remaining
values that may be based on some other property that
depends on recomposition.
|
boolean |
containsExcludeResultPrefix(String prefix,
String uri)
Get whether or not the passed URL is contained flagged by
the "extension-element-prefixes" property.
|
void |
endCompose(StylesheetRoot sroot)
This after the template's children have been composed.
|
void |
error(String msg)
Throw an error.
|
void |
error(String msg,
Object[] args)
Throw a template element runtime error.
|
void |
execute(TransformerImpl transformer)
Execute the element's primary function.
|
void |
exprAddChild(ExpressionNode n,
int i)
This method tells the node to add its argument to the node's
list of children.
|
ExpressionNode |
exprGetChild(int i)
This method returns a child node.
|
int |
exprGetNumChildren()
Return the number of children the node has.
|
ExpressionNode |
exprGetParent()
Get the ExpressionNode parent of this node.
|
void |
exprSetParent(ExpressionNode n)
Set the parent of this node.
|
String |
getBaseIdentifier()
Return the base identifier.
|
NodeList |
getChildNodes()
Return the nodelist (same reference).
|
int |
getColumnNumber()
Return the column number where the current document event ends.
|
List |
getDeclaredPrefixes()
Return a table that contains all prefixes available
within this element context.
|
Node |
getDOMBackPointer()
If this stylesheet was created from a DOM, get the
DOM backpointer that this element originated from.
|
int |
getEndColumnNumber()
Return the column number where the current document event ends.
|
int |
getEndLineNumber()
Return the line number where the current document event ends.
|
Node |
getFirstChild()
Get the first child as a Node.
|
ElemTemplateElement |
getFirstChildElem()
Get the first child as a ElemTemplateElement.
|
Node |
getLastChild()
Get the last child.
|
ElemTemplateElement |
getLastChildElem()
Get the last child.
|
int |
getLength()
NodeList method: Count the immediate children of this node
|
int |
getLineNumber()
Return the line number where the current document event ends.
|
String |
getLocalName()
For now, just return the result of getNodeName(), which
the local name.
|
String |
getNamespaceForPrefix(String prefix)
Given a namespace, get the corrisponding prefix.
|
String |
getNamespaceForPrefix(String prefix,
Node context)
Fullfill the PrefixResolver interface.
|
Node |
getNextSibling()
Get the next sibling (as a Node) or return null.
|
ElemTemplateElement |
getNextSiblingElem()
Get the next sibling (as a ElemTemplateElement) or return null.
|
String |
getNodeName()
Return the node name.
|
short |
getNodeType()
Get the type of the node.
|
Document |
getOwnerDocument()
Get the stylesheet owner.
|
ElemTemplate |
getOwnerXSLTemplate()
Get the owning xsl:template element.
|
ElemTemplateElement |
getParentElem()
Get the parent as an ElemTemplateElement.
|
Node |
getParentNode()
Get the parent as a Node.
|
ElemTemplateElement |
getParentNodeElem()
Get the parent element.
|
Node |
getPreviousSibling()
Get the previous sibling (as a Node) or return null.
|
ElemTemplateElement |
getPreviousSiblingElem()
Get the previous sibling (as a Node) or return null.
|
String |
getPublicId()
Return the public identifier for the current document event.
|
Stylesheet |
getStylesheet()
Get the owning stylesheet.
|
StylesheetComposed |
getStylesheetComposed()
Get the owning "composed" stylesheet.
|
StylesheetRoot |
getStylesheetRoot()
Get the owning root stylesheet.
|
String |
getSystemId()
Return the system identifier for the current document event.
|
String |
getTagName()
Return the element name.
|
int |
getUid()
Get the UID (document order index).
|
boolean |
getXmlSpace()
Get the "xml:space" attribute.
|
int |
getXSLToken()
Get an integer representation of the element type.
|
boolean |
handlesNullPrefixes() |
boolean |
hasChildNodes()
Tell if there are child nodes.
|
boolean |
hasTextLitOnly()
Tell if this element only has one text child, for optimization purposes.
|
boolean |
hasVariableDecl() |
Node |
insertBefore(Node newChild,
Node refChild)
Unimplemented.
|
boolean |
isCompiledTemplate()
Tell if this template is a compiled template.
|
Node |
item(int index)
NodeList method: Return the Nth immediate child of this node, or
null if the index is out of bounds.
|
void |
recompose(StylesheetRoot root)
This function is called during recomposition to
control how this element is composed.
|
ElemTemplateElement |
removeChild(ElemTemplateElement childETE)
Remove a child.
|
ElemTemplateElement |
replaceChild(ElemTemplateElement newChildElem,
ElemTemplateElement oldChildElem)
Replace the old child with a new child.
|
Node |
replaceChild(Node newChild,
Node oldChild)
Replace the old child with a new child.
|
void |
resolvePrefixTables()
Combine the parent's namespaces with this namespace
for fast processing, taking care to reference the
parent's namespace if this namespace adds nothing new.
|
void |
runtimeInit(TransformerImpl transformer)
This function will be called on top-level elements
only, just before the transform begins.
|
void |
setDOMBackPointer(Node n)
If this stylesheet was created from a DOM, set the
DOM backpointer that this element originated from.
|
void |
setEndLocaterInfo(SourceLocator locator)
Set the end location information for this element.
|
void |
setLocaterInfo(SourceLocator locator)
Set the location information for this element.
|
void |
setParentElem(ElemTemplateElement p)
Set the parent as an ElemTemplateElement.
|
void |
setPrefixes(org.xml.sax.helpers.NamespaceSupport nsSupport)
From the SAX2 helper class, set the namespace table for
this element.
|
void |
setPrefixes(org.xml.sax.helpers.NamespaceSupport nsSupport,
boolean excludeXSLDecl)
Copy the namespace declarations from the NamespaceSupport object.
|
void |
setUid(int i)
Set the UID (document order index).
|
void |
setXmlSpace(int v)
Set the "xml:space" attribute.
|
boolean |
shouldStripWhiteSpace(XPathContext support,
Element targetElement)
Get information about whether or not an element should strip whitespace.
|
adoptNode, appendData, cloneNode, compareDocumentPosition, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, getActualEncoding, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getBaseURI, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getImplementation, getInputEncoding, getNamespaceURI, getNodeValue, getOwnerElement, getPrefix, getSchemaTypeInfo, getSpecified, getStrictErrorChecking, getTextContent, getUserData, getWholeText, getXmlEncoding, getXmlStandalone, getXmlVersion, hasAttribute, hasAttributeNS, hasAttributes, importNode, insertData, isDefaultNamespace, isEqualNode, isId, isSameNode, isSupported, isWhitespaceInElementContent, lookupNamespaceURI, lookupPrefix, normalize, normalizeDocument, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, renameNode, replaceData, replaceWholeText, setActualEncoding, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setDocumentURI, setIdAttribute, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setInputEncoding, setNodeValue, setPrefix, setStrictErrorChecking, setTextContent, setUserData, setValue, setXmlEncoding, setXmlStandalone, setXmlVersion, splitText, substringData
protected boolean m_hasVariableDecl
protected int m_docOrderNumber
protected ElemTemplateElement m_parentNode
public ElemTemplateElement()
public boolean isCompiledTemplate()
public int getXSLToken()
Constants
public String getNodeName()
getNodeName
in interface Node
getNodeName
in class UnImplNode
public String getLocalName()
getLocalName
in interface Node
getLocalName
in class UnImplNode
public void runtimeInit(TransformerImpl transformer) throws TransformerException
transformer
- The XSLT TransformerFactory.TransformerException
public void execute(TransformerImpl transformer) throws TransformerException
transformer
- The XSLT TransformerFactory.TransformerException
- if any checked exception occurs.public StylesheetComposed getStylesheetComposed()
public Stylesheet getStylesheet()
public StylesheetRoot getStylesheetRoot()
public void recompose(StylesheetRoot root) throws TransformerException
TransformerException
public void compose(StylesheetRoot sroot) throws TransformerException
TransformerException
public void endCompose(StylesheetRoot sroot) throws TransformerException
TransformerException
public void error(String msg, Object[] args)
error
in class UnImplNode
msg
- key of the error that occured.args
- Arguments to be used in the messagepublic void error(String msg)
UnImplNode
error
in class UnImplNode
msg
- Message Key for the errorpublic Node appendChild(Node newChild) throws DOMException
appendChild
in interface Node
appendChild
in class UnImplNode
newChild
- Child to be added to child listDOMException
public ElemTemplateElement appendChild(ElemTemplateElement elem)
elem
- Child to be added to child listpublic boolean hasChildNodes()
hasChildNodes
in interface Node
hasChildNodes
in class UnImplNode
public short getNodeType()
getNodeType
in interface Node
getNodeType
in class UnImplNode
public NodeList getChildNodes()
getChildNodes
in interface Node
getChildNodes
in class UnImplNode
public ElemTemplateElement removeChild(ElemTemplateElement childETE)
childETE
- The child to remove. This operation is a no-op
if oldChild is not a child of this node.public Node replaceChild(Node newChild, Node oldChild) throws DOMException
replaceChild
in interface Node
replaceChild
in class UnImplNode
newChild
- New child to replace witholdChild
- Old child to be replacedDOMException
public Node insertBefore(Node newChild, Node refChild) throws DOMException
insertBefore
in interface Node
insertBefore
in class UnImplNode
newChild
- New child node to insertrefChild
- Insert in front of this childDOMException
public ElemTemplateElement replaceChild(ElemTemplateElement newChildElem, ElemTemplateElement oldChildElem)
newChildElem
- New child to replace witholdChildElem
- Old child to be replacedDOMException
public int getLength()
getLength
in interface NodeList
getLength
in class UnImplNode
public Node item(int index)
item
in interface NodeList
item
in class UnImplNode
index
- Index of child to findpublic Document getOwnerDocument()
getOwnerDocument
in interface Node
getOwnerDocument
in class UnImplNode
public ElemTemplate getOwnerXSLTemplate()
public String getTagName()
getTagName
in interface Element
getTagName
in class UnImplNode
public boolean hasTextLitOnly()
public String getBaseIdentifier()
getBaseIdentifier
in interface PrefixResolver
public int getEndLineNumber()
getColumnNumber()
public int getLineNumber()
getLineNumber
in interface SourceLocator
getColumnNumber()
public int getEndColumnNumber()
getLineNumber()
public int getColumnNumber()
getColumnNumber
in interface SourceLocator
getLineNumber()
public String getPublicId()
This will be the public identifier
getPublicId
in interface SourceLocator
getSystemId()
public String getSystemId()
If the system identifier is a URL, the parser must resolve it fully before passing it to the application.
getSystemId
in interface SourceLocator
getPublicId()
public void setLocaterInfo(SourceLocator locator)
locator
- Source Locator with location information for this elementpublic void setEndLocaterInfo(SourceLocator locator)
locator
- Source Locator with location information for this elementpublic boolean hasVariableDecl()
public void setXmlSpace(int v)
v
- Enumerated value, either Constants.ATTRVAL_PRESERVE
or Constants.ATTRVAL_STRIP.public boolean getXmlSpace()
public List getDeclaredPrefixes()
public void setPrefixes(org.xml.sax.helpers.NamespaceSupport nsSupport) throws TransformerException
nsSupport
- non-null reference to NamespaceSupport from
the ContentHandler.TransformerException
public void setPrefixes(org.xml.sax.helpers.NamespaceSupport nsSupport, boolean excludeXSLDecl) throws TransformerException
nsSupport
- non-null reference to NamespaceSupport from
the ContentHandler.excludeXSLDecl
- true if XSLT namespaces should be ignored.TransformerException
public String getNamespaceForPrefix(String prefix, Node context)
getNamespaceForPrefix
in interface PrefixResolver
prefix
- The prefix to look up, which may be an empty string ("")
for the default Namespace.context
- The node context from which to look up the URI.public String getNamespaceForPrefix(String prefix)
getNamespaceForPrefix
in interface PrefixResolver
prefix
- non-null reference to prefix string, which should map
to a namespace URL.public boolean containsExcludeResultPrefix(String prefix, String uri)
ElemLiteralResult.containsExcludeResultPrefix(java.lang.String, java.lang.String)
.prefix
- non-null reference to prefix that might be excluded.public void resolvePrefixTables() throws TransformerException
TransformerException
public void setUid(int i)
i
- Index of this child.public int getUid()
public Node getParentNode()
getParentNode
in interface Node
getParentNode
in class UnImplNode
public ElemTemplateElement getParentElem()
public void setParentElem(ElemTemplateElement p)
p
- This node's parent as an ElemTemplateElementpublic Node getNextSibling()
getNextSibling
in interface Node
getNextSibling
in class UnImplNode
public Node getPreviousSibling()
getPreviousSibling
in interface Node
getPreviousSibling
in class UnImplNode
public ElemTemplateElement getPreviousSiblingElem()
public ElemTemplateElement getNextSiblingElem()
public ElemTemplateElement getParentNodeElem()
public Node getFirstChild()
getFirstChild
in interface Node
getFirstChild
in class UnImplNode
public ElemTemplateElement getFirstChildElem()
public Node getLastChild()
getLastChild
in interface Node
getLastChild
in class UnImplNode
public ElemTemplateElement getLastChildElem()
public Node getDOMBackPointer()
public void setDOMBackPointer(Node n)
n
- DOM backpointer that this element originated from.public int compareTo(Object o) throws ClassCastException
o
- The object to be compared to this objectClassCastException
- if the specified object's
type prevents it from being compared to this Object.public boolean shouldStripWhiteSpace(XPathContext support, Element targetElement) throws TransformerException
shouldStripWhiteSpace
in interface WhitespaceStrippingElementMatcher
support
- The XPath runtime state.targetElement
- Element to checkTransformerException
public boolean canStripWhiteSpace()
canStripWhiteSpace
in interface WhitespaceStrippingElementMatcher
public boolean canAcceptVariables()
public void exprSetParent(ExpressionNode n)
exprSetParent
in interface ExpressionNode
n
- Must be a ElemTemplateElement.public ExpressionNode exprGetParent()
exprGetParent
in interface ExpressionNode
public void exprAddChild(ExpressionNode n, int i)
exprAddChild
in interface ExpressionNode
n
- Must be a ElemTemplateElement.public ExpressionNode exprGetChild(int i)
exprGetChild
in interface ExpressionNode
public int exprGetNumChildren()
exprGetNumChildren
in interface ExpressionNode
protected boolean accept(XSLTVisitor visitor)
visitor
- The visitor whose appropriate method will be called.public void callVisitors(XSLTVisitor visitor)
XSLTVisitable
callVisitors
in interface XSLTVisitable
visitor
- The visitor whose appropriate method will be called.XSLTVisitable.callVisitors(XSLTVisitor)
protected void callChildVisitors(XSLTVisitor visitor, boolean callAttributes)
visitor
- The visitor whose appropriate method will be called.protected void callChildVisitors(XSLTVisitor visitor)
visitor
- The visitor whose appropriate method will be called.public boolean handlesNullPrefixes()
handlesNullPrefixes
in interface PrefixResolver
PrefixResolver.handlesNullPrefixes()
Copyright © 2018 JBoss by Red Hat. All rights reserved.