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

Function3Args

public class Function3Args extends Function2Args
Base class for functions that accept three arguments.
xsl.usage
advanced

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

see
XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)

  	super.callArgVisitors(visitor);
  	if(null != m_arg2)
  		m_arg2.callVisitors(new Arg2Owner(), 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 super.canTraverseOutsideSubtree() 
    ? true : m_arg2.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 != 3)
      reportWrongNumberArgs();
  
public booleandeepEquals(com.sun.org.apache.xpath.internal.Expression expr)

see
Expression#deepEquals(Expression)

  	if(!super.deepEquals(expr))
  		return false;
  		
  	if(null != m_arg2)
  	{
  		if(null == ((Function3Args)expr).m_arg2)
  			return false;

  		if(!m_arg2.deepEquals(((Function3Args)expr).m_arg2))
  			return false;
  	}
  	else if (null != ((Function3Args)expr).m_arg2)
  		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).

    super.fixupVariables(vars, globalsSize);
    if(null != m_arg2)
      m_arg2.fixupVariables(vars, globalsSize);
  
public com.sun.org.apache.xpath.internal.ExpressiongetArg2()
Return the third argument passed to the function (at index 2).

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

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

throws
WrongNumberArgsException

      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("three", 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 2.


    if (argNum < 2)
      super.setArg(arg, argNum);
    else if (2 == argNum)
    {
      m_arg2 = arg;
      arg.exprSetParent(this);
    }
    else
		  reportWrongNumberArgs();