FileDocCategorySizeDatePackage
FunctionOneArg.javaAPI DocJava SE 5 API4629Fri Aug 26 14:56:08 BST 2005com.sun.org.apache.xpath.internal.functions

FunctionOneArg

public class FunctionOneArg extends Function implements ExpressionOwner
Base class for functions that accept one argument.
xsl.usage
advanced

Fields Summary
Expression
m_arg0
The first argument passed to the function (at index 0).
Constructors Summary
Methods Summary
public voidcallArgVisitors(com.sun.org.apache.xpath.internal.XPathVisitor visitor)

see
XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)

  	if(null != m_arg0)
  		m_arg0.callVisitors(this, visitor);
  
public booleancanTraverseOutsideSubtree()
Tell if this expression or it's subexpressions can traverse outside the current subtree.

return
true if traversal outside the context node's subtree can occur.

    return m_arg0.canTraverseOutsideSubtree();
   
public voidcheckNumberArgs(int argNum)
Check that the number of arguments passed to this function is correct.

param
argNum The number of arguments that is being passed to the function.
throws
WrongNumberArgsException

    if (argNum != 1)
      reportWrongNumberArgs();
  
public booleandeepEquals(com.sun.org.apache.xpath.internal.Expression expr)

see
Expression#deepEquals(Expression)

  	if(!super.deepEquals(expr))
  		return false;
  		
  	if(null != m_arg0)
  	{
  		if(null == ((FunctionOneArg)expr).m_arg0)
  			return false;
  			
  		if(!m_arg0.deepEquals(((FunctionOneArg)expr).m_arg0))
  			return false;
  	}
  	else if(null != ((FunctionOneArg)expr).m_arg0)
  		return false;

  	return true;
  
public voidfixupVariables(java.util.Vector vars, int globalsSize)
This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.

param
vars List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corresponds to the variable reference qname. The position of the QName in the vector from the start of the vector will be its position in the stack frame (but variables above the globalsTop value will need to be offset to the current stack frame).

    if(null != m_arg0)
      m_arg0.fixupVariables(vars, globalsSize);
  
public com.sun.org.apache.xpath.internal.ExpressiongetArg0()
Return the first argument passed to the function (at index 0).

return
An expression that represents the first argument passed to the function.

    return m_arg0;
  
public com.sun.org.apache.xpath.internal.ExpressiongetExpression()

see
ExpressionOwner#getExpression()

    return m_arg0;
  
protected voidreportWrongNumberArgs()
Constructs and throws a WrongNumberArgException with the appropriate message for this function object.

throws
WrongNumberArgsException

      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("one", null));
  
public voidsetArg(com.sun.org.apache.xpath.internal.Expression arg, int argNum)
Set an argument expression for a function. This method is called by the XPath compiler.

param
arg non-null expression that represents the argument.
param
argNum The argument number index.
throws
WrongNumberArgsException If the argNum parameter is greater than 0.


    if (0 == argNum)
    {
      m_arg0 = arg;
      arg.exprSetParent(this);
    }
    else
      reportWrongNumberArgs();
  
public voidsetExpression(com.sun.org.apache.xpath.internal.Expression exp)

see
ExpressionOwner#setExpression(Expression)

  	exp.exprSetParent(this);
  	m_arg0 = exp;