FileDocCategorySizeDatePackage
Arg.javaAPI DocJava SE 5 API6240Fri Aug 26 14:56:06 BST 2005com.sun.org.apache.xpath.internal

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.
xsl.usage
internal

Fields Summary
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
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. 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.
Constructors Summary
public Arg()
Construct a dummy parameter argument, with no QName and no value (either expression string or value XObject). isVisible defaults to true.


    m_qname = new QName("");
    ;  // so that string compares can be done.
    m_val = null;
    m_expression = null;
    m_isVisible = true;
    m_isFromWithParam = false;
  
public Arg(QName qname, String expression, boolean isFromWithParam)
Construct a parameter argument that contains an expression.

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


    m_qname = qname;
    m_val = null;
    m_expression = expression;
    m_isFromWithParam = isFromWithParam;
    m_isVisible = !isFromWithParam;
  
public Arg(QName qname, XObject val)
Construct a parameter argument which has an XObject value. isVisible defaults to true.

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


    m_qname = qname;
    m_val = val;
    m_isVisible = true;
    m_isFromWithParam = false;
    m_expression = null;
  
public Arg(QName qname, XObject val, boolean isFromWithParam)
Construct a parameter argument.

param
qname Name of the argument, expressed as a QName object.
param
val Value of the argument, expressed as an XObject
param
isFromWithParam True if this is a parameter variable.


    m_qname = qname;
    m_val = val;
    m_isFromWithParam = isFromWithParam;
    m_isVisible = !isFromWithParam;
    m_expression = null;
  
Methods Summary
public voiddetach()
Have the object release it's resources. Call only when the variable or argument is going out of scope.

    if(null != m_val)
    {
      m_val.allowDetachToRelease(true);
      m_val.detach();
    }
  
public booleanequals(java.lang.Object obj)
Equality function specialized for the variable name. If the argument is not a qname, it will deligate to the super class.

param
obj the reference object with which to compare.
return
true if this object is the same as the obj argument; false otherwise.

    if(obj instanceof QName)
    {
      return m_qname.equals(obj);
    }
    else
      return super.equals(obj);
  
public java.lang.StringgetExpression()
Get the value expression for this argument.

return
String containing the expression previously stored into this argument
see
#setExpression

    return m_expression;
  
public final com.sun.org.apache.xml.internal.utils.QNamegetQName()
Get the qualified name for this argument.

return
QName object containing the qualified name

    return m_qname;
  
public final com.sun.org.apache.xpath.internal.objects.XObjectgetVal()
Get the value for this argument.

return
the argument's stored XObject value.
see
#setVal(XObject)

    return m_val;
  
public booleanisFromWithParam()
Tell if this variable is a parameter passed with a with-param or as a top-level parameter.

    return m_isFromWithParam;
   
public booleanisVisible()
Tell if this variable is currently visible.

    return m_isVisible;
   
public voidsetExpression(java.lang.String expr)
Set the value expression for this argument.

param
expr String containing the expression to be stored as this argument's value.
see
#getExpression

    m_expression = expr;
  
public voidsetIsVisible(boolean b)
Update visibility status of this variable.

    m_isVisible = b;
   
public final voidsetQName(com.sun.org.apache.xml.internal.utils.QName name)
Set the qualified name for this argument.

param
name QName object representing the new Qualified Name.

    m_qname = name;
  
public final voidsetVal(com.sun.org.apache.xpath.internal.objects.XObject val)
Set the value of this argument.

param
val an XObject representing the arguments's value.
see
#getVal()

    m_val = val;