public final class ProxyElement extends NodeImpl implements NodeInfo, FingerprintedNode, SourceLocator, SearchElement
Modifier and Type | Field and Description |
---|---|
(package private) int[] |
attrNames
Pre-computed attribute names
|
(package private) String[] |
attrValues
Pre-computed attribute values
|
(package private) LazyDocument |
document
Document to use for loading
|
(package private) ElementImpl |
element
The actual element (null until loaded)
|
(package private) int |
nodeNum
Node number represented by this element
|
nameCode, nextSibNum, NODE_LETTER, parentNum, prevSibNum
Constructor and Description |
---|
ProxyElement(LazyDocument realDocument)
General constructor, attaches to a given lazy-loading document
|
Modifier and Type | Method and Description |
---|---|
void |
allocateAttributes(int nAttrs)
Allocate the attribute array.
|
Value |
atomize()
Get the typed value.
|
int |
compareOrder(NodeInfo other)
Loads the real node and defers to it
|
void |
copy(Receiver out,
int whichNamespaces,
boolean copyAnnotations,
int locationId)
Loads the real node and defers to it
|
void |
generateId(FastStringBuffer buffer)
Loads the real node and defers to it
|
String |
getAttributeValue(int fingerprint)
Loads the real node and defers to it
|
String |
getBaseURI()
Loads the real node and defers to it
|
int |
getColumnNumber()
Loads the real node and defers to it
|
Configuration |
getConfiguration()
Get the configuration
|
int[] |
getDeclaredNamespaces(int[] buffer)
Loads the real node and defers to it
|
String |
getDisplayName()
Loads the real node and defers to it
|
int |
getDocumentNumber()
Loads the real node and defers to it
|
DocumentInfo |
getDocumentRoot()
Loads the real node and defers to it
|
int |
getFingerprint()
Loads the real node and defers to it
|
int |
getLineNumber()
Loads the real node and defers to it
|
String |
getLocalPart()
Loads the real node and defers to it
|
int |
getNameCode()
Loads the real node and defers to it
|
NamePool |
getNamePool()
Loads the real node and defers to it
|
int |
getNodeKind()
Loads the real node and defers to it
|
NodeInfo |
getParent()
Loads the real node and defers to it
|
String |
getPrefix()
Loads the real node and defers to it
|
String |
getPublicId()
Loads the real node and defers to it
|
NodeInfo |
getRoot()
Loads the real node and defers to it
|
long |
getSequenceNumber()
Loads the real node and defers to it
|
String |
getStringValue()
Loads the real node and defers to it
|
CharSequence |
getStringValueCS()
Loads the real node and defers to it
|
String |
getSystemId()
Loads the real node and defers to it
|
int |
getTypeAnnotation()
Loads the real node and defers to it
|
SequenceIterator |
getTypedValue()
Loads the real node and defers to it
|
String |
getURI()
Loads the real node and defers to it
|
boolean |
hasChildNodes()
Loads the real node and defers to it
|
boolean |
isSameNodeInfo(NodeInfo other)
Loads the real node and defers to it
|
AxisIterator |
iterateAxis(byte axisNumber)
Loads the real node and defers to it
|
AxisIterator |
iterateAxis(byte axisNumber,
NodeTest nodeTest)
If only the attributes are accessed, uses ProxyAttributeEnumeration
to serve up the pre-computed attributes.
|
private ElementImpl |
real()
Obtain the real underlying ElementImpl.
|
void |
sendNamespaceDeclarations(Receiver out,
boolean includeAncestors)
Loads the real node and defers to it
|
void |
setAttribute(int attrNum,
int nameCode,
String value)
Set an attribute
|
void |
setChildNum(int num)
Establish the child node number
|
void |
setNameCode(int code)
Establish a name for this node
|
void |
setNextSibNum(int num)
Establish the next sibling node number
|
void |
setNodeNum(int nodeNum)
Set the node number for this node.
|
void |
setParentNum(int newParentNum)
Establish the parent node number
|
void |
setPrevSibNum(int num)
Establish the previous sibling node number
|
void |
setSystemId(String systemId)
Loads the real node and defers to it
|
equals, getFirstChild, getLastChild, getNextInDocument, getNextSibling, getPreviousInDocument, getPreviousSibling, hashCode, init
ElementImpl element
LazyDocument document
int nodeNum
int[] attrNames
String[] attrValues
public ProxyElement(LazyDocument realDocument)
public void setNodeNum(int nodeNum)
setNodeNum
in interface SearchNode
public void allocateAttributes(int nAttrs)
allocateAttributes
in interface SearchElement
public void setAttribute(int attrNum, int nameCode, String value)
setAttribute
in interface SearchElement
public void setParentNum(int newParentNum)
setParentNum
in interface SearchNode
public void setChildNum(int num)
setChildNum
in interface SearchElement
public void setNextSibNum(int num)
setNextSibNum
in interface SearchNode
public void setPrevSibNum(int num)
setPrevSibNum
in interface SearchNode
public void setNameCode(int code)
setNameCode
in interface SearchElement
private final ElementImpl real()
public long getSequenceNumber()
getSequenceNumber
in class NodeImpl
public int compareOrder(NodeInfo other)
compareOrder
in interface NodeInfo
compareOrder
in class NodeImpl
other
- The other node, whose position is to be compared with this nodepublic Configuration getConfiguration()
NodeImpl
getConfiguration
in interface NodeInfo
getConfiguration
in class NodeImpl
public void generateId(FastStringBuffer buffer)
generateId
in interface NodeInfo
generateId
in class NodeImpl
public String getAttributeValue(int fingerprint)
getAttributeValue
in interface NodeInfo
getAttributeValue
in class NodeImpl
fingerprint
- The fingerprint of the attribute namepublic String getBaseURI()
getBaseURI
in interface NodeInfo
getBaseURI
in class NodeImpl
public int getFingerprint()
getFingerprint
in interface NodeInfo
getFingerprint
in class NodeImpl
public String getLocalPart()
getLocalPart
in interface NodeInfo
getLocalPart
in class NodeImpl
public int getNameCode()
getNameCode
in interface NodeInfo
getNameCode
in class NodeImpl
public NodeInfo getParent()
public String getStringValue()
getStringValue
in interface Item
getStringValue
in interface NodeInfo
getStringValue
in interface ValueRepresentation
public String getSystemId()
getSystemId
in interface Source
getSystemId
in interface SourceLocator
getSystemId
in interface NodeInfo
getSystemId
in class NodeImpl
public String getURI()
public boolean hasChildNodes()
hasChildNodes
in interface NodeInfo
hasChildNodes
in class NodeImpl
true
if the node has any children,
false
if the node has no children.public boolean isSameNodeInfo(NodeInfo other)
isSameNodeInfo
in interface NodeInfo
isSameNodeInfo
in class NodeImpl
public AxisIterator iterateAxis(byte axisNumber, NodeTest nodeTest)
iterateAxis
in interface NodeInfo
iterateAxis
in class NodeImpl
axisNumber
- The axis to be iterated overnodeTest
- A pattern to be matched by the returned nodespublic String getPrefix()
public void copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId) throws XPathException
copy
in interface NodeInfo
XPathException
public NamePool getNamePool()
getNamePool
in interface NodeInfo
getNamePool
in class NodeImpl
public int getNodeKind()
getNodeKind
in interface NodeInfo
public AxisIterator iterateAxis(byte axisNumber)
iterateAxis
in interface NodeInfo
iterateAxis
in class NodeImpl
axisNumber
- The axis to be iterated overpublic void setSystemId(String systemId)
setSystemId
in interface Source
setSystemId
in class NodeImpl
public String getDisplayName()
getDisplayName
in interface NodeInfo
getDisplayName
in class NodeImpl
public int getDocumentNumber()
getDocumentNumber
in interface NodeInfo
getDocumentNumber
in class NodeImpl
public DocumentInfo getDocumentRoot()
getDocumentRoot
in interface NodeInfo
getDocumentRoot
in class NodeImpl
public NodeInfo getRoot()
public int getTypeAnnotation()
getTypeAnnotation
in interface NodeInfo
getTypeAnnotation
in class NodeImpl
public void sendNamespaceDeclarations(Receiver out, boolean includeAncestors) throws XPathException
sendNamespaceDeclarations
in interface NodeInfo
sendNamespaceDeclarations
in class NodeImpl
out
- The relevant outputterincludeAncestors
- True if namespaces declared on ancestor elements mustXPathException
public int getColumnNumber()
getColumnNumber
in interface SourceLocator
getColumnNumber
in class NodeImpl
public int[] getDeclaredNamespaces(int[] buffer)
getDeclaredNamespaces
in interface NodeInfo
getDeclaredNamespaces
in class NodeImpl
buffer
- If this is non-null, and the result array fits in this buffer, then the result
may overwrite the contents of this array, to avoid the cost of allocating a new array on the heap.For a node other than an element, the method returns null.
public int getLineNumber()
getLineNumber
in interface SourceLocator
getLineNumber
in interface NodeInfo
getLineNumber
in class NodeImpl
public String getPublicId()
getPublicId
in interface SourceLocator
getPublicId
in class NodeImpl
public CharSequence getStringValueCS()
getStringValueCS
in interface Item
getStringValueCS
in interface ValueRepresentation
getStringValueCS
in class NodeImpl
public SequenceIterator getTypedValue() throws XPathException
getTypedValue
in interface Item
getTypedValue
in class NodeImpl
XPathException
public Value atomize() throws XPathException
NodeImpl
Item.getTypedValue()
. However, this method is often more convenient and may be
more efficient, especially in the common case where the value is expected to be a singleton.