APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.org.apache.xpath.internal.functions

public Class FuncExtFunction

extends Function
Class Inheritance
Imports
com.sun.org.apache.xalan.internal.res.XSLMessages, com.sun.org.apache.xml.internal.utils.QName, com.sun.org.apache.xpath.internal.Expression, .ExpressionNode, .ExpressionOwner, .ExtensionsProvider, .XPathContext, .XPathVisitor, com.sun.org.apache.xpath.internal.objects.XNull, .XObject, com.sun.org.apache.xpath.internal.res.XPATHErrorResources, .XPATHMessages, java.util.ArrayList, .List, javax.xml.transform.TransformerException

An object of this class represents an extension call expression. When the expression executes, it calls ExtensionsTable#extFunction, and then converts the result to the appropriate XObject.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
pack-priv List<Expression>
m_argVec

Array of static expressions which represent the parameters to the function.

pack-priv String
m_extensionName

The local name of the extension.

pack-priv Object
m_methodKey

Unique method key, which is passed to ExtensionsTable#extFunction in order to allow caching of the method.

pack-priv String
m_namespace

The namespace for the extension function, which should not normally be null or empty.

pack-priv static final long

Constructor Summary

AccessConstructor and Description
public
FuncExtFunction(String
The namespace for the extension function, which should not normally be null or empty.
namespace
,
String
The local name of the extension.
extensionName
,
Object
Unique method key, which is passed to ExtensionsTable#extFunction in order to allow caching of the method.
methodKey
)

Create a new FuncExtFunction based on the qualified name of the extension, and a unique method key.

Method Summary

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

Overrides com.sun.org.apache.xpath.internal.functions.Function.callArgVisitors.

Call the visitors for the function arguments.

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

Overrides com.sun.org.apache.xpath.internal.functions.Function.checkNumberArgs.

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

public XObject

Returns:

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

Overrides com.sun.org.apache.xpath.internal.functions.Function.execute.

Execute the function.

public void
public void
fixupVariables(List<QName>
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). NEEDSDOC @param globalsSize
vars
,
int globalsSize)

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

This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.

public Expression

Returns:

The Expression object at the given index.
getArg
(int
The argument number index.
n
)

Return the nth argument passed to the extension function.

public int

Returns:

The number of arguments.
getArgCount
()

Return the number of arguments that were passed into this extension function.

public String

Returns:

The name of the extension function.
getFunctionName
()

Return the name of the extension function.

public Object

Returns:

The method key of the extension function.
getMethodKey
()

Return the method key of the extension function.

public String

Returns:

The namespace of the extension function.
getNamespace
()

Return the namespace of the extension function.

protected void
reportWrongNumberArgs()

Overrides com.sun.org.apache.xpath.internal.functions.Function.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
)

Overrides com.sun.org.apache.xpath.internal.functions.Function.setArg.

Set an argument expression for a function.

public String
toString()

Overrides java.lang.Object.toString.

Return the name of the extesion function in string format

Inherited from com.sun.org.apache.xpath.internal.functions.Function:
callVisitorsdeepEqualspostCompileStep

Field Detail

m_argVecback to summary
pack-priv List<Expression> m_argVec

Array of static expressions which represent the parameters to the function.

Annotations
@SuppressWarnings:serial
m_extensionNameback to summary
pack-priv String m_extensionName

The local name of the extension.

m_methodKeyback to summary
pack-priv Object m_methodKey

Unique method key, which is passed to ExtensionsTable#extFunction in order to allow caching of the method.

Annotations
@SuppressWarnings:serial
m_namespaceback to summary
pack-priv String m_namespace

The namespace for the extension function, which should not normally be null or empty.

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides com.sun.org.apache.xpath.internal.functions.Function.serialVersionUID.

Constructor Detail

FuncExtFunctionback to summary
public FuncExtFunction(String namespace, String extensionName, Object methodKey)

Create a new FuncExtFunction based on the qualified name of the extension, and a unique method key.

Parameters
namespace:String

The namespace for the extension function, which should not normally be null or empty.

extensionName:String

The local name of the extension.

methodKey:Object

Unique method key, which is passed to ExtensionsTable#extFunction in order to allow caching of the method.

Method Detail

callArgVisitorsback to summary
public void callArgVisitors(XPathVisitor visitor)

Overrides com.sun.org.apache.xpath.internal.functions.Function.callArgVisitors.

Call the visitors for the function arguments.

checkNumberArgsback to summary
public void checkNumberArgs(int argNum) throws WrongNumberArgsException

Overrides com.sun.org.apache.xpath.internal.functions.Function.checkNumberArgs.

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

Parameters
argNum:int

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

executeback to summary
public XObject execute(XPathContext xctxt) throws TransformerException

Overrides com.sun.org.apache.xpath.internal.functions.Function.execute.

Execute the function. The function must return a valid object.

Parameters
xctxt:XPathContext

The current execution context.

Returns:XObject

A valid XObject.

Exceptions
TransformerException:

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

if a runtime exception occurs.

exprSetParentback to summary
public void exprSetParent(ExpressionNode n)

Overrides com.sun.org.apache.xpath.internal.Expression.exprSetParent.

Implements com.sun.org.apache.xpath.internal.ExpressionNode.exprSetParent.

Set the parent node. For an extension function, we also need to set the parent node for all argument expressions.

Parameters
n:ExpressionNode

The parent node

fixupVariablesback to summary
public void fixupVariables(List<QName> vars, int globalsSize)

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

This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.

Parameters
vars:List<QName>

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). NEEDSDOC @param globalsSize

getArgback to summary
public Expression getArg(int n)

Return the nth argument passed to the extension function.

Parameters
n:int

The argument number index.

Returns:Expression

The Expression object at the given index.

getArgCountback to summary
public int getArgCount()

Return the number of arguments that were passed into this extension function.

Returns:int

The number of arguments.

getFunctionNameback to summary
public String getFunctionName()

Return the name of the extension function.

Returns:String

The name of the extension function.

getMethodKeyback to summary
public Object getMethodKey()

Return the method key of the extension function.

Returns:Object

The method key of the extension function.

getNamespaceback to summary
public String getNamespace()

Return the namespace of the extension function.

Returns:String

The namespace of the extension function.

reportWrongNumberArgsback to summary
protected void reportWrongNumberArgs() throws WrongNumberArgsException

Overrides com.sun.org.apache.xpath.internal.functions.Function.reportWrongNumberArgs.

Constructs and throws a WrongNumberArgException with the appropriate message for this function object. This class supports an arbitrary number of arguments, so this method must never be called.

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

Overrides com.sun.org.apache.xpath.internal.functions.Function.setArg.

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.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Return the name of the extesion function in string format

com.sun.org.apache.xpath.internal.functions back to summary

pack-priv Class FuncExtFunction.ArgExtOwner

extends Object
implements ExpressionOwner
Class Inheritance
  • java.lang.Object
  • com.sun.org.apache.xpath.internal.functions.FuncExtFunction.ArgExtOwner
All Implemented Interfaces
com.sun.org.apache.xpath.internal.ExpressionOwner

Field Summary

Modifier and TypeField and Description
pack-priv Expression

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Expression
getExpression()

Implements com.sun.org.apache.xpath.internal.ExpressionOwner.getExpression.

Get the raw Expression object that this class wraps.

public void
setExpression(Expression exp)

Implements com.sun.org.apache.xpath.internal.ExpressionOwner.setExpression.

Set the raw expression object for this object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_expback to summary
pack-priv Expression m_exp

Constructor Detail

ArgExtOwnerback to summary
pack-priv ArgExtOwner(Expression exp)

Method Detail

getExpressionback to summary
public Expression getExpression()

Implements com.sun.org.apache.xpath.internal.ExpressionOwner.getExpression.

Doc from com.sun.org.apache.xpath.internal.ExpressionOwner.getExpression.

Get the raw Expression object that this class wraps.

See Also
ExpressionOwner#getExpression()
setExpressionback to summary
public void setExpression(Expression exp)

Implements com.sun.org.apache.xpath.internal.ExpressionOwner.setExpression.

Doc from com.sun.org.apache.xpath.internal.ExpressionOwner.setExpression.

Set the raw expression object for this object.

See Also
ExpressionOwner#setExpression(Expression)