Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## weblogic.apache.xpath
Class VariableStack

    java.lang.Object
      |
      +--weblogic.apache.xpath.VariableStack

public class VariableStack
extends java.lang.Object
implements java.lang.Cloneable

Defines a class to keep track of a stack for template arguments and variables.

This has been changed from the previous incarnations of this class to be fairly low level.

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.

Constructor Summary
`VariableStack()` Constructor for a variable stack.

Method Summary
`void` | `clearLocalSlots(int start, int len)` Use this to clear the variables in a section of the stack.
`java.lang.Object` | `clone()` Returns a clone of this variable stack.
`XObject` | `elementAt(int i)` Get the element at the given index, regardless of stackframe.
`XObject` | `getGlobalVariable(XPathContext xctxt, int index)` Get a global variable or parameter from the global stack frame.
`XObject` | `getLocalVariable(int index, int frame)` Get a local variable or parameter in the current stack frame.
`XObject` | `getLocalVariable(XPathContext xctxt, int index)` Get a local variable or parameter in the current stack frame.
`int` | `getStackFrame()` 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` | `getVariableOrParam(XPathContext xctxt, QName qname)` Get a variable based on it's qualified name.
`boolean` | `isLocalSet(int index)` Tell if a local variable has been set or not.
`int` | `link(int size)` Allocates memory (called a stackframe) on the stack; used to store local variables and parameter arguments.
`void` | `reset()` Reset the stack to a start position.
`void` | `setGlobalVariable(int index, XObject val)` Set a global variable or parameter in the global stack frame.
`void` | `setLocalVariable(int index, XObject val)` Set a local variable or parameter in the current stack frame.
`void` | `setLocalVariable(int index, XObject val, int stackFrame)` Set a local variable or parameter in the specified stack frame.
`void` | `setStackFrame(int sf)` Set the current stack frame.
`int` | `size()` Get size of the stack.
`void` | `unlink()` Free up the stack frame that was last allocated with `link(int size)`.
`void` | `unlink(int currentFrame)` Free up the stack frame that was last allocated with `link(int size)`.

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### VariableStack

    public VariableStack()

  Constructor for a variable stack.

Method Detail

### clone

    public java.lang.Object clone()
                           throws java.lang.CloneNotSupportedException

  Returns a clone of this variable stack.

  Returns:
    a clone of this variable stack.
  Throws:
    java.lang.CloneNotSupportedException -
  Overrides:
    clone in class java.lang.Object

### elementAt

    public XObject elementAt(int i)

  Get the element at the given index, regardless of stackframe.

  Parameters:
    `i` - index from zero.
  Returns:
    The item at the given index.

### size

    public int size()

  Get size of the stack.

  Returns:
    the total size of the execution stack.

### reset

    public void reset()

  Reset the stack to a start position.

  Returns:
    the total size of the execution stack.

### setStackFrame

    public void setStackFrame(int sf)

  Set the current stack frame.

  Parameters:
    `sf` - The new stack frame position.

### getStackFrame

    public int getStackFrame()

  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.

  Returns:
    The current stack frame position.

### link

    public int link(int size)

  Allocates memory (called a stackframe) on the stack; used to store local variables and parameter arguments.

  I use the link/unlink concept because of distant Motorola 68000 assembler memories.

  Parameters:
    `size` - The size of the stack frame allocation. This ammount should normally be the maximum number of variables that you can have allocated at one time in the new stack frame.
  Returns:
    The bottom of the stack frame, from where local variable addressing should start from.

### unlink

    public void unlink()

  Free up the stack frame that was last allocated with `link(int size)`.

### unlink

    public void unlink(int currentFrame)

  Free up the stack frame that was last allocated with `link(int size)`.

  Parameters:
    `currentFrame` - The current frame to set to after the unlink.

### setLocalVariable

    public void setLocalVariable(int index,
                                 XObject val)

  Set a local variable or parameter in the current stack frame.

  Parameters:
    `index` - Local variable index relative to the current stack frame bottom.
    `val` - The value of the variable that is being set.

### setLocalVariable

    public void setLocalVariable(int index,
                                 XObject val,
                                 int stackFrame)

  Set a local variable or parameter in the specified stack frame.

  Parameters:
    `index` - Local variable index relative to the current stack frame bottom. NEEDSDOC @param stackFrame
    `val` - The value of the variable that is being set.

### getLocalVariable

    public XObject getLocalVariable(XPathContext xctxt,
                                    int index)
                             throws javax.xml.transform.TransformerException

  Get a local variable or parameter in the current stack frame.

  Parameters:
    `xctxt` - The XPath context, which must be passed in order to lazy evaluate variables.
    `index` - Local variable index relative to the current stack frame bottom.
  Returns:
    The value of the variable.
  Throws:
    javax.xml.transform.TransformerException -

### getLocalVariable

    public XObject getLocalVariable(int index,
                                    int frame)
                             throws javax.xml.transform.TransformerException

  Get a local variable or parameter in the current stack frame.

  Parameters:
    `index` - Local variable index relative to the given frame bottom. NEEDSDOC @param frame
  Returns:
    The value of the variable.
  Throws:
    javax.xml.transform.TransformerException -

### isLocalSet

    public boolean isLocalSet(int index)
                       throws javax.xml.transform.TransformerException

  Tell if a local variable has been set or not.

  Parameters:
    `index` - Local variable index relative to the current stack frame bottom.
  Returns:
    true if the value at the index is not null.
  Throws:
    javax.xml.transform.TransformerException -

### clearLocalSlots

    public void clearLocalSlots(int start,
                                int len)

  Use this to clear the variables in a section of the stack. This is used to clear the parameter section of the stack, so that default param values can tell if they've already been set. It is important to note that this function has a 1K limitation.

  Parameters:
    `start` - The start position, relative to the current local stack frame.
    `len` - The number of slots to be cleared.

### setGlobalVariable

    public void setGlobalVariable(int index,
                                  XObject val)

  Set a global variable or parameter in the global stack frame.

  Parameters:
    `index` - Local variable index relative to the global stack frame bottom.
    `val` - The value of the variable that is being set.

### getGlobalVariable

    public XObject getGlobalVariable(XPathContext xctxt,
                                     int index)
                              throws javax.xml.transform.TransformerException

  Get a global variable or parameter from the global stack frame.

  Parameters:
    `xctxt` - The XPath context, which must be passed in order to lazy evaluate variables.
    `index` - Global variable index relative to the global stack frame bottom.
  Returns:
    The value of the variable.
  Throws:
    javax.xml.transform.TransformerException -

### getVariableOrParam

    public XObject getVariableOrParam(XPathContext xctxt,
                                      QName qname)
                               throws javax.xml.transform.TransformerException

  Get a variable based on it's qualified name. This is for external use only.

  Parameters:
    `xctxt` - The XPath context, which must be passed in order to lazy evaluate variables.
    `qname` - The qualified name of the variable.
  Returns:
    The evaluated value of the variable.
  Throws:
    javax.xml.transform.TransformerException -

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at http://e-docs.bea.com/wls/docs70
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 BEA Systems, Inc. All Rights Reserved.
WebLogic Server 7.0 API Reference