Class PathTreeBuilder
- java.lang.Object
-
- org.antlr.v4.runtime.tree.AbstractParseTreeVisitor<T>
-
- io.trino.jsonpath.JsonPathBaseVisitor<PathNode>
-
- io.trino.sql.jsonpath.PathTreeBuilder
-
- All Implemented Interfaces:
JsonPathVisitor<PathNode>,org.antlr.v4.runtime.tree.ParseTreeVisitor<PathNode>
public class PathTreeBuilder extends JsonPathBaseVisitor<PathNode>
-
-
Constructor Summary
Constructors Constructor Description PathTreeBuilder()
-
Method Summary
-
Methods inherited from class io.trino.jsonpath.JsonPathBaseVisitor
visitAccessorExpressionDefault, visitComparisonOperator, visitExpressionDefault, visitIdentifier, visitLiteral, visitLiteralPrimary, visitNonReserved, visitPathMode, visitPredicateDefault, visitPredicatePrimaryDefault, visitSubscript, visitVariablePrimary
-
Methods inherited from class org.antlr.v4.runtime.tree.AbstractParseTreeVisitor
defaultResult, shouldVisitNextChild, visit, visitChildren, visitErrorNode, visitTerminal
-
-
-
-
Method Detail
-
visitPath
public PathNode visitPath(JsonPathParser.PathContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced byJsonPathParser.path().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitPathin interfaceJsonPathVisitor<PathNode>- Overrides:
visitPathin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitDecimalLiteral
public PathNode visitDecimalLiteral(JsonPathParser.DecimalLiteralContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thedecimalLiterallabeled alternative inJsonPathParser.numericLiteral().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitDecimalLiteralin interfaceJsonPathVisitor<PathNode>- Overrides:
visitDecimalLiteralin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitDoubleLiteral
public PathNode visitDoubleLiteral(JsonPathParser.DoubleLiteralContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thedoubleLiterallabeled alternative inJsonPathParser.numericLiteral().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitDoubleLiteralin interfaceJsonPathVisitor<PathNode>- Overrides:
visitDoubleLiteralin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitIntegerLiteral
public PathNode visitIntegerLiteral(JsonPathParser.IntegerLiteralContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by theintegerLiterallabeled alternative inJsonPathParser.numericLiteral().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitIntegerLiteralin interfaceJsonPathVisitor<PathNode>- Overrides:
visitIntegerLiteralin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitStringLiteral
public PathNode visitStringLiteral(JsonPathParser.StringLiteralContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced byJsonPathParser.stringLiteral().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitStringLiteralin interfaceJsonPathVisitor<PathNode>- Overrides:
visitStringLiteralin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitNullLiteral
public PathNode visitNullLiteral(JsonPathParser.NullLiteralContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced byJsonPathParser.nullLiteral().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitNullLiteralin interfaceJsonPathVisitor<PathNode>- Overrides:
visitNullLiteralin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitBooleanLiteral
public PathNode visitBooleanLiteral(JsonPathParser.BooleanLiteralContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced byJsonPathParser.booleanLiteral().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitBooleanLiteralin interfaceJsonPathVisitor<PathNode>- Overrides:
visitBooleanLiteralin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitContextVariable
public PathNode visitContextVariable(JsonPathParser.ContextVariableContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thecontextVariablelabeled alternative inJsonPathParser.variable().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitContextVariablein interfaceJsonPathVisitor<PathNode>- Overrides:
visitContextVariablein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitNamedVariable
public PathNode visitNamedVariable(JsonPathParser.NamedVariableContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thenamedVariablelabeled alternative inJsonPathParser.variable().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitNamedVariablein interfaceJsonPathVisitor<PathNode>- Overrides:
visitNamedVariablein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitLastIndexVariable
public PathNode visitLastIndexVariable(JsonPathParser.LastIndexVariableContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thelastIndexVariablelabeled alternative inJsonPathParser.variable().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitLastIndexVariablein interfaceJsonPathVisitor<PathNode>- Overrides:
visitLastIndexVariablein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitPredicateCurrentItemVariable
public PathNode visitPredicateCurrentItemVariable(JsonPathParser.PredicateCurrentItemVariableContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thepredicateCurrentItemVariablelabeled alternative inJsonPathParser.variable().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitPredicateCurrentItemVariablein interfaceJsonPathVisitor<PathNode>- Overrides:
visitPredicateCurrentItemVariablein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitParenthesizedPath
public PathNode visitParenthesizedPath(JsonPathParser.ParenthesizedPathContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by theparenthesizedPathlabeled alternative inJsonPathParser.pathPrimary().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitParenthesizedPathin interfaceJsonPathVisitor<PathNode>- Overrides:
visitParenthesizedPathin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitMemberAccessor
public PathNode visitMemberAccessor(JsonPathParser.MemberAccessorContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thememberAccessorlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitMemberAccessorin interfaceJsonPathVisitor<PathNode>- Overrides:
visitMemberAccessorin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitWildcardMemberAccessor
public PathNode visitWildcardMemberAccessor(JsonPathParser.WildcardMemberAccessorContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thewildcardMemberAccessorlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitWildcardMemberAccessorin interfaceJsonPathVisitor<PathNode>- Overrides:
visitWildcardMemberAccessorin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitArrayAccessor
public PathNode visitArrayAccessor(JsonPathParser.ArrayAccessorContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thearrayAccessorlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitArrayAccessorin interfaceJsonPathVisitor<PathNode>- Overrides:
visitArrayAccessorin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitWildcardArrayAccessor
public PathNode visitWildcardArrayAccessor(JsonPathParser.WildcardArrayAccessorContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thewildcardArrayAccessorlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitWildcardArrayAccessorin interfaceJsonPathVisitor<PathNode>- Overrides:
visitWildcardArrayAccessorin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitFilter
public PathNode visitFilter(JsonPathParser.FilterContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thefilterlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitFilterin interfaceJsonPathVisitor<PathNode>- Overrides:
visitFilterin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitTypeMethod
public PathNode visitTypeMethod(JsonPathParser.TypeMethodContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thetypeMethodlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitTypeMethodin interfaceJsonPathVisitor<PathNode>- Overrides:
visitTypeMethodin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitSizeMethod
public PathNode visitSizeMethod(JsonPathParser.SizeMethodContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thesizeMethodlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitSizeMethodin interfaceJsonPathVisitor<PathNode>- Overrides:
visitSizeMethodin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitDoubleMethod
public PathNode visitDoubleMethod(JsonPathParser.DoubleMethodContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thedoubleMethodlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitDoubleMethodin interfaceJsonPathVisitor<PathNode>- Overrides:
visitDoubleMethodin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitCeilingMethod
public PathNode visitCeilingMethod(JsonPathParser.CeilingMethodContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by theceilingMethodlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitCeilingMethodin interfaceJsonPathVisitor<PathNode>- Overrides:
visitCeilingMethodin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitFloorMethod
public PathNode visitFloorMethod(JsonPathParser.FloorMethodContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thefloorMethodlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitFloorMethodin interfaceJsonPathVisitor<PathNode>- Overrides:
visitFloorMethodin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitAbsMethod
public PathNode visitAbsMethod(JsonPathParser.AbsMethodContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by theabsMethodlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitAbsMethodin interfaceJsonPathVisitor<PathNode>- Overrides:
visitAbsMethodin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitDatetimeMethod
public PathNode visitDatetimeMethod(JsonPathParser.DatetimeMethodContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thedatetimeMethodlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitDatetimeMethodin interfaceJsonPathVisitor<PathNode>- Overrides:
visitDatetimeMethodin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitKeyValueMethod
public PathNode visitKeyValueMethod(JsonPathParser.KeyValueMethodContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thekeyValueMethodlabeled alternative inJsonPathParser.accessorExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitKeyValueMethodin interfaceJsonPathVisitor<PathNode>- Overrides:
visitKeyValueMethodin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitSignedUnary
public PathNode visitSignedUnary(JsonPathParser.SignedUnaryContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thesignedUnarylabeled alternative inJsonPathParser.pathExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitSignedUnaryin interfaceJsonPathVisitor<PathNode>- Overrides:
visitSignedUnaryin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitBinary
public PathNode visitBinary(JsonPathParser.BinaryContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thebinarylabeled alternative inJsonPathParser.pathExpression().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitBinaryin interfaceJsonPathVisitor<PathNode>- Overrides:
visitBinaryin classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitComparisonPredicate
public PathNode visitComparisonPredicate(JsonPathParser.ComparisonPredicateContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thecomparisonPredicatelabeled alternative inJsonPathParser.predicatePrimary().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitComparisonPredicatein interfaceJsonPathVisitor<PathNode>- Overrides:
visitComparisonPredicatein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitConjunctionPredicate
public PathNode visitConjunctionPredicate(JsonPathParser.ConjunctionPredicateContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by theconjunctionPredicatelabeled alternative inJsonPathParser.predicate().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitConjunctionPredicatein interfaceJsonPathVisitor<PathNode>- Overrides:
visitConjunctionPredicatein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitDisjunctionPredicate
public PathNode visitDisjunctionPredicate(JsonPathParser.DisjunctionPredicateContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thedisjunctionPredicatelabeled alternative inJsonPathParser.predicate().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitDisjunctionPredicatein interfaceJsonPathVisitor<PathNode>- Overrides:
visitDisjunctionPredicatein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitExistsPredicate
public PathNode visitExistsPredicate(JsonPathParser.ExistsPredicateContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by theexistsPredicatelabeled alternative inJsonPathParser.delimitedPredicate().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitExistsPredicatein interfaceJsonPathVisitor<PathNode>- Overrides:
visitExistsPredicatein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitIsUnknownPredicate
public PathNode visitIsUnknownPredicate(JsonPathParser.IsUnknownPredicateContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by theisUnknownPredicatelabeled alternative inJsonPathParser.predicatePrimary().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitIsUnknownPredicatein interfaceJsonPathVisitor<PathNode>- Overrides:
visitIsUnknownPredicatein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitLikeRegexPredicate
public PathNode visitLikeRegexPredicate(JsonPathParser.LikeRegexPredicateContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thelikeRegexPredicatelabeled alternative inJsonPathParser.predicatePrimary().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitLikeRegexPredicatein interfaceJsonPathVisitor<PathNode>- Overrides:
visitLikeRegexPredicatein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitNegationPredicate
public PathNode visitNegationPredicate(JsonPathParser.NegationPredicateContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thenegationPredicatelabeled alternative inJsonPathParser.predicate().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitNegationPredicatein interfaceJsonPathVisitor<PathNode>- Overrides:
visitNegationPredicatein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitParenthesizedPredicate
public PathNode visitParenthesizedPredicate(JsonPathParser.ParenthesizedPredicateContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by theparenthesizedPredicatelabeled alternative inJsonPathParser.delimitedPredicate().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitParenthesizedPredicatein interfaceJsonPathVisitor<PathNode>- Overrides:
visitParenthesizedPredicatein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
visitStartsWithPredicate
public PathNode visitStartsWithPredicate(JsonPathParser.StartsWithPredicateContext context)
Description copied from class:JsonPathBaseVisitorVisit a parse tree produced by thestartsWithPredicatelabeled alternative inJsonPathParser.predicatePrimary().The default implementation returns the result of calling
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode)onctx.- Specified by:
visitStartsWithPredicatein interfaceJsonPathVisitor<PathNode>- Overrides:
visitStartsWithPredicatein classJsonPathBaseVisitor<PathNode>- Parameters:
context- the parse tree- Returns:
- the visitor result
-
-