Class CoreFunction
java.lang.Object
org.apache.commons.jxpath.ri.compiler.Expression
org.apache.commons.jxpath.ri.compiler.Operation
org.apache.commons.jxpath.ri.compiler.CoreFunction
An element of the compile tree representing one of built-in functions like "position()" or "number()".
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.jxpath.ri.compiler.Expression
Expression.PointerIterator, Expression.ValueIterator -
Field Summary
Fields inherited from class org.apache.commons.jxpath.ri.compiler.Expression
NOT_A_NUMBER, ONE -
Constructor Summary
ConstructorsConstructorDescriptionCoreFunction(int functionCode, Expression[] args) Constructs a new CoreFunction. -
Method Summary
Modifier and TypeMethodDescriptioncompute(EvalContext context) Evaluates the expression.booleanReturns true if any argument is context dependent or if the function is last(), position(), boolean(), local-name(), name(), string(), lang(), number().computeValue(EvalContext context) Evaluates the expression.protected ObjectfunctionBoolean(EvalContext context) boolean() implementation.protected ObjectfunctionCeiling(EvalContext context) ceiling() implementation.protected ObjectfunctionConcat(EvalContext context) concat() implementation.protected ObjectfunctionContains(EvalContext context) contains() implementation.protected ObjectfunctionCount(EvalContext context) count() implementation.protected ObjectfunctionEndsWith(EvalContext context) ends-with() implementation.protected ObjectfunctionFalse(EvalContext context) false() implementation.protected ObjectfunctionFloor(EvalContext context) floor() implementation.protected ObjectfunctionID(EvalContext context) id() implementation.protected ObjectfunctionKey(EvalContext context) key() implementation.protected ObjectfunctionLang(EvalContext context) lang() implementation.protected ObjectfunctionLast(EvalContext context) last() implementation.protected ObjectfunctionLocalName(EvalContext context) local-name() implementation.protected ObjectfunctionName(EvalContext context) name() implementation.protected ObjectfunctionNamespaceURI(EvalContext context) namespace-uri() implementation.protected ObjectfunctionNormalizeSpace(EvalContext context) normalize-space() implementation.protected ObjectfunctionNot(EvalContext context) not() implementation.protected ObjectfunctionNull(EvalContext context) null() implementation.protected ObjectfunctionNumber(EvalContext context) number() implementation.protected ObjectfunctionPosition(EvalContext context) position() implementation.protected ObjectfunctionRound(EvalContext context) round() implementation.protected ObjectfunctionStartsWith(EvalContext context) starts-with() implementation.protected ObjectfunctionString(EvalContext context) string() implementation.protected ObjectfunctionStringLength(EvalContext context) string-length() implementation.protected ObjectfunctionSubstring(EvalContext context) substring() implementation.protected ObjectfunctionSubstringAfter(EvalContext context) substring-after() implementation.protected ObjectfunctionSubstringBefore(EvalContext context) substring-before() implementation.protected ObjectfunctionSum(EvalContext context) sum() implementation.protected ObjectfunctionTranslate(EvalContext context) translate() implementation.protected ObjectfunctionTrue(EvalContext context) true() implementation.getArg1()Convenience method to return the first argument.getArg2()Convenience method to return the second argument.getArg3()Convenience method to return the third argument.intGets the number of argument Expressions.intGets the function code.protected StringGets the name of this function.toString()Methods inherited from class org.apache.commons.jxpath.ri.compiler.Operation
getArgumentsMethods inherited from class org.apache.commons.jxpath.ri.compiler.Expression
isContextDependent, iterate, iteratePointers
-
Constructor Details
-
CoreFunction
Constructs a new CoreFunction.- Parameters:
functionCode- int function codeargs- argument Expressions
-
-
Method Details
-
compute
Description copied from class:ExpressionEvaluates the expression. If the result is a node set, returns the first element of the node set.- Specified by:
computein classExpression- Parameters:
context- evaluation context- Returns:
- Object
-
computeContextDependent
Returns true if any argument is context dependent or if the function is last(), position(), boolean(), local-name(), name(), string(), lang(), number().- Overrides:
computeContextDependentin classOperation- Returns:
- boolean
-
computeValue
Description copied from class:ExpressionEvaluates the expression. If the result is a node set, returns the first element of the node set.- Specified by:
computeValuein classExpression- Parameters:
context- evaluation context- Returns:
- Object
-
functionBoolean
boolean() implementation.- Parameters:
context- evaluation context- Returns:
- Boolean
-
functionCeiling
ceiling() implementation.- Parameters:
context- evaluation context- Returns:
- Number
-
functionConcat
concat() implementation.- Parameters:
context- evaluation context- Returns:
- String
-
functionContains
contains() implementation.- Parameters:
context- evaluation context- Returns:
- Boolean
-
functionCount
count() implementation.- Parameters:
context- evaluation context- Returns:
- Number
-
functionEndsWith
ends-with() implementation.- Parameters:
context- evaluation context- Returns:
- Boolean
- Since:
- 1.4.0
-
functionFalse
false() implementation.- Parameters:
context- evaluation context- Returns:
- Boolean.FALSE
-
functionFloor
floor() implementation.- Parameters:
context- evaluation context- Returns:
- Number
-
functionID
id() implementation.- Parameters:
context- evaluation context- Returns:
- Pointer
-
functionKey
key() implementation.- Parameters:
context- evaluation context- Returns:
- various Object
-
functionLang
lang() implementation.- Parameters:
context- evaluation context- Returns:
- Boolean
-
functionLast
last() implementation.- Parameters:
context- evaluation context- Returns:
- Number
-
functionLocalName
local-name() implementation.- Parameters:
context- evaluation context- Returns:
- String
-
functionName
name() implementation.- Parameters:
context- evaluation context- Returns:
- String
-
functionNamespaceURI
namespace-uri() implementation.- Parameters:
context- evaluation context- Returns:
- String
-
functionNormalizeSpace
normalize-space() implementation.- Parameters:
context- evaluation context- Returns:
- String
-
functionNot
not() implementation.- Parameters:
context- evaluation context- Returns:
- Boolean
-
functionNull
null() implementation.- Parameters:
context- evaluation context- Returns:
- null
-
functionNumber
number() implementation.- Parameters:
context- evaluation context- Returns:
- Number
-
functionPosition
position() implementation.- Parameters:
context- evaluation context- Returns:
- Number
-
functionRound
round() implementation.- Parameters:
context- evaluation context- Returns:
- Number
-
functionStartsWith
starts-with() implementation.- Parameters:
context- evaluation context- Returns:
- Boolean
-
functionString
string() implementation.- Parameters:
context- evaluation context- Returns:
- String
-
functionStringLength
string-length() implementation.- Parameters:
context- evaluation context- Returns:
- Number
-
functionSubstring
substring() implementation.- Parameters:
context- evaluation context- Returns:
- String
-
functionSubstringAfter
substring-after() implementation.- Parameters:
context- evaluation context- Returns:
- String
-
functionSubstringBefore
substring-before() implementation.- Parameters:
context- evaluation context- Returns:
- String
-
functionSum
sum() implementation.- Parameters:
context- evaluation context- Returns:
- Number
-
functionTranslate
translate() implementation.- Parameters:
context- evaluation context- Returns:
- String
-
functionTrue
true() implementation.- Parameters:
context- evaluation context- Returns:
- Boolean.TRUE
-
getArg1
Convenience method to return the first argument.- Returns:
- Expression
-
getArg2
Convenience method to return the second argument.- Returns:
- Expression
-
getArg3
Convenience method to return the third argument.- Returns:
- Expression
-
getArgumentCount
Gets the number of argument Expressions.- Returns:
- int count
-
getFunctionCode
Gets the function code.- Returns:
- int function code
-
getFunctionName
Gets the name of this function.- Returns:
- String function name
-
toString
-