Top Description Fields Constructors Methods
com.sun.org.apache.xpath.internal.functions

public abstract Class Function

extends Expression
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xpath.internal.functions.FunctionOneArg, com.sun.org.apache.xpath.internal.functions.FuncTrue, com.sun.org.apache.xpath.internal.functions.FuncLast, com.sun.org.apache.xpath.internal.functions.FuncCurrent, com.sun.org.apache.xpath.internal.functions.FuncExtFunction, com.sun.org.apache.xpath.internal.functions.FuncFalse, com.sun.org.apache.xpath.internal.functions.FuncHere, com.sun.org.apache.xpath.internal.functions.FuncPosition
Imports
com.sun.org.apache.xalan.internal.res.XSLMessages, com.sun.org.apache.xpath.internal.Expression, .ExpressionOwner, .XPathContext, .XPathVisitor, com.sun.org.apache.xpath.internal.compiler.Compiler, com.sun.org.apache.xpath.internal.objects.XObject

This is a superclass of all XPath functions. This allows two ways for the class to be called. One method is that the super class processes the arguments and hands the results to the derived class, the other method is that the derived class may process it's own arguments, which is faster since the arguments don't have to be added to an array, but causes a larger code footprint.

Field Summary

Modifier and TypeField and Description
pack-priv static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
callArgVisitors(XPathVisitor visitor)

Call the visitors for the function arguments.

public void
callVisitors(ExpressionOwner
The owner of the visitor, where that path may be rewritten if needed.
owner
,
XPathVisitor
The visitor whose appropriate method will be called.
visitor
)

Implements com.sun.org.apache.xpath.internal.XPathVisitable.callVisitors.

This will traverse the heararchy, calling the visitor for each member.

public void
checkNumberArgs(int
The number of arguments that is being passed to the function.
argNum
)

Check that the number of arguments passed to this function is correct.

public boolean
deepEquals(Expression
Another expression object.
expr
)

Implements abstract com.sun.org.apache.xpath.internal.Expression.deepEquals.

Compare this object with another object and see if they are equal, include the sub heararchy.

public XObject

Returns:

A valid XObject.
execute
(XPathContext
The execution current context.
xctxt
)

Implements abstract com.sun.org.apache.xpath.internal.Expression.execute.

Execute an XPath function object.

public void
postCompileStep(Compiler compiler)

This function is currently only being used by Position() and Last().

protected void
reportWrongNumberArgs()

Constructs and throws a WrongNumberArgException with the appropriate message for this function object.

public void
setArg(Expression
non-null expression that represents the argument.
arg
,
int
The argument number index.
argNum
)

Set an argument expression for a function.

Inherited from com.sun.org.apache.xpath.internal.Expression:
asIteratorasIteratorRawasNodeassertionboolcanTraverseOutsideSubtreeerrorexecuteexecuteexecuteexecuteCharsToContentHandlerexprAddChildexprGetChildexprGetNumChildrenexprGetParentexprSetParentfixupVariablesgetColumnNumbergetExpressionOwnergetLineNumbergetPublicIdgetSystemIdisNodesetExprisSameClassisStableNumbernumwarnxstr

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides com.sun.org.apache.xpath.internal.Expression.serialVersionUID.

Constructor Detail

Functionback to summary
public Function()

Method Detail

callArgVisitorsback to summary
public void callArgVisitors(XPathVisitor visitor)

Call the visitors for the function arguments.

callVisitorsback to summary
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)

Implements com.sun.org.apache.xpath.internal.XPathVisitable.callVisitors.

Doc from com.sun.org.apache.xpath.internal.XPathVisitable.callVisitors.

This will traverse the heararchy, calling the visitor for each member. If the called visitor method returns false, the subtree should not be called.

Parameters
owner:ExpressionOwner

The owner of the visitor, where that path may be rewritten if needed.

visitor:XPathVisitor

The visitor whose appropriate method will be called.

See Also
com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
checkNumberArgsback to summary
public void checkNumberArgs(int argNum) throws WrongNumberArgsException

Check that the number of arguments passed to this function is correct. This method is meant to be overloaded by derived classes, to check for the number of arguments for a specific function type. This method is called by the compiler for static number of arguments checking.

Parameters
argNum:int

The number of arguments that is being passed to the function.

deepEqualsback to summary
public boolean deepEquals(Expression expr)

Implements abstract com.sun.org.apache.xpath.internal.Expression.deepEquals.

Doc from com.sun.org.apache.xpath.internal.Expression.deepEquals.

Compare this object with another object and see if they are equal, include the sub heararchy.

Parameters
expr:Expression

Another expression object.

Returns:boolean

true if this objects class and the expr object's class are the same, and the data contained within both objects are considered equal.

See Also
Expression#deepEquals(Expression)
executeback to summary
public XObject execute(XPathContext xctxt) throws TransformerException

Implements abstract com.sun.org.apache.xpath.internal.Expression.execute.

Execute an XPath function object. The function must return a valid object.

Parameters
xctxt:XPathContext

The execution current context.

Returns:XObject

A valid XObject.

Exceptions
TransformerException:

Doc from com.sun.org.apache.xpath.internal.Expression.execute.

if a runtime exception occurs.

postCompileStepback to summary
public void postCompileStep(Compiler compiler)

This function is currently only being used by Position() and Last(). See respective functions for more detail.

reportWrongNumberArgsback to summary
protected void reportWrongNumberArgs() throws WrongNumberArgsException

Constructs and throws a WrongNumberArgException with the appropriate message for this function object. This method is meant to be overloaded by derived classes so that the message will be as specific as possible.

setArgback to summary
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException

Set an argument expression for a function. This method is called by the XPath compiler.

Parameters
arg:Expression

non-null expression that represents the argument.

argNum:int

The argument number index.

Exceptions
WrongNumberArgsException:
If the argNum parameter is beyond what is specified for this function.