|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractCollection | +--java.util.AbstractList | +--java.util.Vector | +--java.util.Stack | +--org.apache.xpath.VariableStack
**For internal use only** Defines a class to keep track of a stack for template arguments and variables. The VariableStack extends Stack, and each element in the stack is a stack frame, i.e. a Stack itself. The zero element is the global stack frame. Note: Someone recently made the suggestion that the globals should not be kept at the bottom of the stack, but should be implemented in a hash table.
Constructor Summary | |
VariableStack()
Constructor for a variable stack. |
Method Summary | |
int |
getContextPos()
Get the current context position. |
Arg |
getParamArg(QName qname)
Get the variable argument. |
int |
getSearchStart()
Get the position to start the search, or -1 if the search should start from the top. |
int |
getSearchStartOrTop()
Get the position from where the search should start, which is either the searchStart property, or the top of the stack if that value is -1. |
XObject |
getVariable(XPathContext xctxt,
QName name)
Given a name, return an object representing the value. |
void |
markGlobalStackFrame()
Mark the top of the global stack frame. |
void |
popContextPosition()
Pop the current context position onto the contextPositions. |
void |
popCurrentContext()
Pop the current context from the current context stack. |
void |
popElemFrame()
Pop the current context from the current context stack. |
void |
pushContextMarker()
Push the current top of the stack as a context marker into the variables stack to let us know when to stop searching for a var. |
void |
pushContextPosition(int pos)
Push a context marker onto the contextPositions stack to let us know when to stop searching for a var. |
void |
pushElemFrame()
Push an argument onto the stack. |
void |
pushOrReplaceVariable(QName qname,
XObject xval)
Push an argument onto the stack, or replace it if it already exists. |
void |
pushVariable(QName qname,
XObject val)
Push an argument onto the stack. |
void |
pushVariableArg(Arg arg)
Push an argument onto the stack. |
void |
remarkParams()
Re-mark the variables in the current frame as all being parameters. |
void |
setSearchStart(int startPos)
Set where to start the current search for a variable. |
boolean |
variableIsDeclared(QName qname)
Tell if a variable or parameter is already declared, either in the current context or in the global space. |
Methods inherited from class java.util.Stack |
empty,
peek,
pop,
push,
search |
Methods inherited from class java.util.Vector |
add,
add,
addAll,
addAll,
addElement,
capacity,
clear,
clone,
contains,
containsAll,
copyInto,
elementAt,
elements,
ensureCapacity,
equals,
firstElement,
get,
hashCode,
indexOf,
indexOf,
insertElementAt,
isEmpty,
lastElement,
lastIndexOf,
lastIndexOf,
remove,
remove,
removeAll,
removeAllElements,
removeElement,
removeElementAt,
retainAll,
set,
setElementAt,
setSize,
size,
subList,
toArray,
toArray,
toString,
trimToSize |
Methods inherited from class java.util.AbstractList |
iterator,
listIterator,
listIterator |
Methods inherited from class java.lang.Object |
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public VariableStack()
Method Detail |
public void setSearchStart(int startPos)
startPos
- The position to start the search, or -1
if the search should start from the top.public int getSearchStartOrTop()
public int getSearchStart()
public void markGlobalStackFrame()
public void pushContextPosition(int pos)
public void popContextPosition()
public int getContextPos()
public void pushContextMarker()
public void popCurrentContext()
public void pushOrReplaceVariable(QName qname, XObject xval)
qname
- The qualified name of the variable.val
- The wrapped value of the variable.public void remarkParams()
public void pushVariable(QName qname, XObject val)
qname
- The qualified name of the variable.val
- The wrapped value of the variable.public void pushVariableArg(Arg arg)
arg
- The variable argument.public boolean variableIsDeclared(QName qname) throws TransformerException
qname
- The qualified name of the variable.public Arg getParamArg(QName qname) throws TransformerException
qname
- The qualified name of the variable.public XObject getVariable(XPathContext xctxt, QName name) throws TransformerException
qname
- The qualified name of the variable.public void pushElemFrame()
public void popElemFrame()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |