|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weblogic.apache.xpath.Expression | +--weblogic.apache.xpath.axes.UnionPathIterator
This class extends NodeSet, which implements NodeIterator, and fetches nodes one at a time in document order based on a XPath UnionExpr. As each node is iterated via nextNode(), the node is also stored in the NodeVector, so that previousNode() can easily be done.
This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.
Field Summary | |
protected org.w3c.dom.Node |
m_context
The node context for the expression. |
protected org.w3c.dom.Node |
m_currentContextNode
The node context from where the Location Path is being executed from (i.e. |
protected XPathContext |
m_execContext
The execution context for the expression. |
protected boolean |
m_foundLast
Tells if we've found the last node yet. |
protected LocPathIterator[] |
m_iterators
The location path iterators, one for each location path contained in the union expression. |
protected int |
m_next
The index of the next node to be fetched. |
Fields inherited from class weblogic.apache.xpath.Expression |
m_slocator |
Constructor Summary | |
UnionPathIterator()
Constructor to create an instance which you can add location paths to. |
|
UnionPathIterator(Compiler compiler,
int opPos)
Create a UnionPathIterator object, including creation of location path iterators from the opcode list, and call back into the Compiler to create predicate expressions. |
Method Summary | |
void |
addIterator(LocPathIterator iter)
Add an iterator to the union list. |
java.lang.Object |
clone()
Get a cloned LocPathIterator that holds the same position as this iterator. |
org.w3c.dom.traversal.NodeIterator |
cloneWithReset()
Get a cloned Iterator that is reset to the beginning of the query. |
protected LocPathIterator |
createLocPathIterator(Compiler compiler,
int opPos)
Create a new location path iterator. |
void |
detach()
Detaches the iterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state. |
XObject |
execute(XPathContext xctxt)
Execute this iterator, meaning create a clone that can store state, and initialize it for fast execution from the current runtime state. |
org.w3c.dom.Node |
getCurrentContextNode()
The node context from where the expression is being executed from (i.e. |
org.w3c.dom.Node |
getCurrentNode()
Return the last fetched node. |
int |
getCurrentPos()
Get the current position, which is one less than the next nextNode() call will retrieve. |
boolean |
getExpandEntityReferences()
The value of this flag determines whether the children of entity reference nodes are visible to the iterator. |
org.w3c.dom.traversal.NodeFilter |
getFilter()
The filter used to screen nodes. |
int |
getLast()
Get the index of the last node in the itteration. |
org.w3c.dom.Node |
getRoot()
The root node of the Iterator, as specified when it was created. |
int |
getWhatToShow()
This attribute determines which node types are presented via the iterator. |
void |
initContext(XPathContext execContext)
Initialize the context values for this expression after it is cloned. |
boolean |
isFresh()
Tells if this NodeSet is "fresh", in other words, if the first nextNode() that is called will return the first node in the set. |
protected void |
loadLocationPaths(Compiler compiler,
int opPos,
int count)
Initialize the location path iterators. |
org.w3c.dom.Node |
nextNode()
Returns the next node in the set and advances the position of the iterator in the set. |
org.w3c.dom.Node |
previousNode()
Returns the previous node in the set and moves the position of the iterator backwards in the set. |
void |
reset()
Reset the iterator. |
void |
runTo(int index)
If an index is requested, NodeSet will call this method to run the iterator to the index. |
void |
setCurrentPos(int i)
Set the current position in the node set. |
void |
setLast(int last)
Set the index of the last node in the itteration. |
void |
setShouldCacheNodes(boolean b)
If setShouldCacheNodes(true) is called, then nodes will be cached. |
int |
size()
Get the length of the list. |
Methods inherited from class weblogic.apache.xpath.Expression |
assert,
canTraverseOutsideSubtree,
error,
setSourceLocator,
warn |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected transient int m_next
protected transient boolean m_foundLast
protected transient XPathContext m_execContext
protected transient org.w3c.dom.Node m_context
protected transient org.w3c.dom.Node m_currentContextNode
protected LocPathIterator[] m_iterators
Constructor Detail |
public UnionPathIterator()
public UnionPathIterator(Compiler compiler, int opPos) throws javax.xml.transform.TransformerException
compiler
- The Compiler which is creating
this expression.opPos
- The position of this iterator in the
opcode list from the compiler.Method Detail |
public void initContext(XPathContext execContext)
execContext
- The XPath runtime context for this
transformation.public void detach()
detach
has been invoked, calls to
nextNode
orpreviousNode
will raise the
exception INVALID_STATE_ERR.
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
xctxt
- The XPath execution context.public void setShouldCacheNodes(boolean b)
b
- True if this iterator should cache nodes.public void setCurrentPos(int i)
i
- Must be a valid index.public int size()
public boolean isFresh()
public org.w3c.dom.Node previousNode() throws org.w3c.dom.DOMException
Node
in the set being iterated over,
ornull
if there are no more members in that set.detach
method was invoked.public int getWhatToShow()
NodeFilter
interface.
public org.w3c.dom.traversal.NodeFilter getFilter()
public org.w3c.dom.Node getRoot()
public boolean getExpandEntityReferences()
public void addIterator(LocPathIterator iter)
iter
- non-null reference to a location path iterator.public org.w3c.dom.traversal.NodeIterator cloneWithReset() throws java.lang.CloneNotSupportedException
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
public void reset()
protected void loadLocationPaths(Compiler compiler, int opPos, int count) throws javax.xml.transform.TransformerException
compiler
- The Compiler which is creating
this expression.opPos
- The position of this iterator in the
opcode list from the compiler.count
- The insert position of the iterator.protected LocPathIterator createLocPathIterator(Compiler compiler, int opPos) throws javax.xml.transform.TransformerException
compiler
- The Compiler which is creating
this expression.opPos
- The position of this iterator in thepublic org.w3c.dom.Node nextNode() throws org.w3c.dom.DOMException
Node
in the set being iterated over, or
null
if there are no more members in that set.detach
method was invoked.public void runTo(int index)
index
- The index to run to, or -1 if the iterator
should run to the end.public int getCurrentPos()
public org.w3c.dom.Node getCurrentNode()
public org.w3c.dom.Node getCurrentContextNode()
public int getLast()
public void setLast(int last)
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs61 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |