JSONPath Tools / @jsonpath-tools/jsonpath / FunctionExpression
Class: FunctionExpression
Function.
Extends
Constructors
new FunctionExpression()
new FunctionExpression(
nameToken,
openingParanthesisToken,
args,
closingParanthesisToken,
name): FunctionExpressionParameters
nameToken
Name token.
openingParanthesisToken
Opening paranthesis token.
args
readonly object[]
Arguments.
closingParanthesisToken
Closing paranthesis token.
name
string
Name.
Returns
FunctionExpression
Overrides
Properties
_parent
_parent: null | SyntaxTreeNode = null;Internal
Inherited from
args
readonly args: readonly object[];Arguments.
children
readonly children: SyntaxTree[];Children.
Inherited from
closingParanthesisToken
readonly closingParanthesisToken: SyntaxTreeToken;Closing paranthesis token.
length
readonly length: number;Length in the text.
Inherited from
name
readonly name: string;Name.
nameToken
readonly nameToken: SyntaxTreeToken;Name token.
openingParanthesisToken
readonly openingParanthesisToken: SyntaxTreeToken;Opening paranthesis token.
position
readonly position: number;Position in the text.
Inherited from
Accessors
parent
Get Signature
get parent(): null | SyntaxTreeNodeParent or null when no parent is assigned.
Returns
null | SyntaxTreeNode
Inherited from
skippedTextBefore
Get Signature
get skippedTextBefore(): stringText that was skipped during parsing.
Returns
string
Text that was skipped during parsing.
Inherited from
FilterExpression.skippedTextBefore
textRange
Get Signature
get textRange(): TextRangeRange in the text.
Returns
Inherited from
textRangeWithoutSkipped
Get Signature
get textRangeWithoutSkipped(): TextRangeRange in the text excluding skipped text before.
Returns
Inherited from
FilterExpression.textRangeWithoutSkipped
type
Get Signature
get type(): SyntaxTreeTypeType.
Returns
Type.
Overrides
Methods
evaluate()
evaluate(queryContext, filterExpressionContext): FilterValueEvaluates the expression in the given context and returns its value.
Parameters
queryContext
Query context.
filterExpressionContext
Filter expression context.
Returns
Inherited from
evaluateImplementation()
protected evaluateImplementation(queryContext, filterExpressionContext): FilterValueEvaluates the expression in the given context and returns its value.
Parameters
queryContext
Query context.
filterExpressionContext
Filter expression context.
Returns
Overrides
FilterExpression.evaluateImplementation
forEach()
forEach(action): voidExecutes the given action for this and all descendant trees in a pre-order tree traversal.
Parameters
action
(tree) => boolean | void
Action.
Returns
void
Inherited from
getAtPosition()
getAtPosition(characterPosition): null | SyntaxTreeReturns the innermost subtree that spans the given character position or null when the position is outside of a range of the current tree.
Parameters
characterPosition
number
Position (character index).
Returns
null | SyntaxTree
Inherited from
FilterExpression.getAtPosition
getContainingAtPosition()
getContainingAtPosition(caretPosition): null | SyntaxTreeReturns the innermost subtree that fully contains the given caret position (not just touches) or null when the position is not contained in a range of the current tree.
Parameters
caretPosition
number
Position (caret position index).
Returns
null | SyntaxTree
Inherited from
FilterExpression.getContainingAtPosition
getTouchingAtPosition()
getTouchingAtPosition(caretPosition): SyntaxTree[]Returns all innermost subtrees that touch the given caret position.
Parameters
caretPosition
number
Position (caret position index).