org.apache.xpath
Class Arg

java.lang.Object
  extended byorg.apache.xpath.Arg

public class Arg
extends Object

This class holds an instance of an argument on the stack. The value of the argument can be either an XObject or a String containing an expression.


Field Summary
private  String m_expression
          Field m_expression: Stored expression value of this argument.
private  boolean m_isFromWithParam
          True if this variable was added with an xsl:with-param or is added via setParameter.
private  boolean m_isVisible
          True if this variable is currently visible.
private  QName m_qname
          Field m_qname: The name of this argument, expressed as a QName (Qualified Name) object.
private  XObject m_val
          Field m_val: Stored XObject value of this argument
 
Constructor Summary
Arg()
          Construct a dummy parameter argument, with no QName and no value (either expression string or value XObject). isVisible defaults to true.
Arg(QName qname, String expression, boolean isFromWithParam)
          Construct a parameter argument that contains an expression.
Arg(QName qname, XObject val)
          Construct a parameter argument which has an XObject value.
Arg(QName qname, XObject val, boolean isFromWithParam)
          Construct a parameter argument.
 
Method Summary
 void detach()
          Have the object release it's resources.
 boolean equals(Object obj)
          Equality function specialized for the variable name.
 String getExpression()
          Get the value expression for this argument.
 QName getQName()
          Get the qualified name for this argument.
 XObject getVal()
          Get the value for this argument.
 boolean isFromWithParam()
          Tell if this variable is a parameter passed with a with-param or as a top-level parameter.
 boolean isVisible()
          Tell if this variable is currently visible.
 void setExpression(String expr)
          Set the value expression for this argument.
 void setIsVisible(boolean b)
          Update visibility status of this variable.
 void setQName(QName name)
          Set the qualified name for this argument.
 void setVal(XObject val)
          Set the value of this argument.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_qname

private QName m_qname
Field m_qname: The name of this argument, expressed as a QName (Qualified Name) object.

See Also:
getQName, setQName

m_val

private XObject m_val
Field m_val: Stored XObject value of this argument

See Also:
getVal(), #setVal()

m_expression

private String m_expression
Field m_expression: Stored expression value of this argument.

See Also:
setExpression(java.lang.String), getExpression()

m_isFromWithParam

private boolean m_isFromWithParam
True if this variable was added with an xsl:with-param or is added via setParameter.


m_isVisible

private boolean m_isVisible
True if this variable is currently visible. To be visible, a variable needs to come either from xsl:variable or be a "received" parameter, ie one for which an xsl:param has been encountered. Set at the time the object is constructed and updated as needed.

Constructor Detail

Arg

public Arg()
Construct a dummy parameter argument, with no QName and no value (either expression string or value XObject). isVisible defaults to true.


Arg

public Arg(QName qname,
           String expression,
           boolean isFromWithParam)
Construct a parameter argument that contains an expression.

Parameters:
qname - Name of the argument, expressed as a QName object.
expression - String to be stored as this argument's value expression.
isFromWithParam - True if this is a parameter variable.

Arg

public Arg(QName qname,
           XObject val)
Construct a parameter argument which has an XObject value. isVisible defaults to true.

Parameters:
qname - Name of the argument, expressed as a QName object.
val - Value of the argument, expressed as an XObject

Arg

public Arg(QName qname,
           XObject val,
           boolean isFromWithParam)
Construct a parameter argument.

Parameters:
qname - Name of the argument, expressed as a QName object.
val - Value of the argument, expressed as an XObject
isFromWithParam - True if this is a parameter variable.
Method Detail

getQName

public final QName getQName()
Get the qualified name for this argument.

Returns:
QName object containing the qualified name

setQName

public final void setQName(QName name)
Set the qualified name for this argument.

Parameters:
name - QName object representing the new Qualified Name.

getVal

public final XObject getVal()
Get the value for this argument.

Returns:
the argument's stored XObject value.
See Also:
setVal(XObject)

setVal

public final void setVal(XObject val)
Set the value of this argument.

Parameters:
val - an XObject representing the arguments's value.
See Also:
getVal()

detach

public void detach()
Have the object release it's resources. Call only when the variable or argument is going out of scope.


getExpression

public String getExpression()
Get the value expression for this argument.

Returns:
String containing the expression previously stored into this argument
See Also:
setExpression(java.lang.String)

setExpression

public void setExpression(String expr)
Set the value expression for this argument.

Parameters:
expr - String containing the expression to be stored as this argument's value.
See Also:
getExpression()

isFromWithParam

public boolean isFromWithParam()
Tell if this variable is a parameter passed with a with-param or as a top-level parameter.


isVisible

public boolean isVisible()
Tell if this variable is currently visible.


setIsVisible

public void setIsVisible(boolean b)
Update visibility status of this variable.


equals

public boolean equals(Object obj)
Equality function specialized for the variable name. If the argument is not a qname, it will deligate to the super class.

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode(), Hashtable