Class ODSLQuery

java.lang.Object
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor<T>
com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
com.walkfares.odsl.ODSLQuery
All Implemented Interfaces:
com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>, org.antlr.v4.runtime.tree.ParseTreeVisitor<com.google.gson.JsonElement>
Direct Known Subclasses:
ODSLAggregation

public class ODSLQuery
extends com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
  • Constructor Summary

    Constructors 
    Constructor Description
    ODSLQuery​(OpenDSLVarVisitor variables)  
  • Method Summary

    Modifier and Type Method Description
    com.google.gson.JsonElement createFilter​(List<com.walkfares.odsl.grammar.OpenDSLParser.ConditionContext> logicCondition)  
    com.google.gson.JsonElement createObjectFilter​(List<com.walkfares.odsl.grammar.OpenDSLParser.ConditionContext> logicCondition)  
    com.google.gson.JsonElement parse​(String condition)  
    com.google.gson.JsonElement visitAddingExpression​(com.walkfares.odsl.grammar.OpenDSLParser.AddingExpressionContext ctx)
    Visit a parse tree produced by OpenDSLParser.addingExpression().
    com.google.gson.JsonElement visitArrayexpression​(com.walkfares.odsl.grammar.OpenDSLParser.ArrayexpressionContext ctx)
    Visit a parse tree produced by OpenDSLParser.arrayexpression().
    com.google.gson.JsonElement visitArrayindex​(com.walkfares.odsl.grammar.OpenDSLParser.ArrayindexContext ctx)
    Visit a parse tree produced by OpenDSLParser.arrayindex().
    com.google.gson.JsonElement visitCondition​(com.walkfares.odsl.grammar.OpenDSLParser.ConditionContext ctx)
    Visit a parse tree produced by OpenDSLParser.condition().
    com.google.gson.JsonElement visitFunctioncall​(com.walkfares.odsl.grammar.OpenDSLParser.FunctioncallContext ctx)
    Visit a parse tree produced by OpenDSLParser.functioncall().
    com.google.gson.JsonElement visitId​(com.walkfares.odsl.grammar.OpenDSLParser.IdContext ctx)
    Visit a parse tree produced by OpenDSLParser.id().
    com.google.gson.JsonElement visitInteger​(com.walkfares.odsl.grammar.OpenDSLParser.IntegerContext ctx)
    Visit a parse tree produced by OpenDSLParser.integer().
    com.google.gson.JsonElement visitJsonObject​(com.walkfares.odsl.grammar.OpenDSLParser.JsonObjectContext ctx)
    Visit a parse tree produced by OpenDSLParser.jsonObject().
    com.google.gson.JsonElement visitMethod​(com.walkfares.odsl.grammar.OpenDSLParser.MethodContext ctx)
    Visit a parse tree produced by OpenDSLParser.method().
    com.google.gson.JsonElement visitMultiplyExpression​(com.walkfares.odsl.grammar.OpenDSLParser.MultiplyExpressionContext ctx)
    Visit a parse tree produced by OpenDSLParser.multiplyExpression().
    com.google.gson.JsonElement visitNumber​(com.walkfares.odsl.grammar.OpenDSLParser.NumberContext ctx)
    Visit a parse tree produced by OpenDSLParser.number().
    com.google.gson.JsonElement visitRowexpression​(com.walkfares.odsl.grammar.OpenDSLParser.RowexpressionContext ctx)
    Visit a parse tree produced by OpenDSLParser.rowexpression().
    com.google.gson.JsonElement visitSingularExpression​(com.walkfares.odsl.grammar.OpenDSLParser.SingularExpressionContext ctx)
    Visit a parse tree produced by OpenDSLParser.singularExpression().
    com.google.gson.JsonElement visitString​(com.walkfares.odsl.grammar.OpenDSLParser.StringContext ctx)
    Visit a parse tree produced by OpenDSLParser.string().
    com.google.gson.JsonElement visitTf​(com.walkfares.odsl.grammar.OpenDSLParser.TfContext ctx)
    Visit a parse tree produced by OpenDSLParser.tf().
    com.google.gson.JsonElement visitUnevaluatedExpression​(com.walkfares.odsl.grammar.OpenDSLParser.UnevaluatedExpressionContext ctx)
    Visit a parse tree produced by OpenDSLParser.unevaluatedExpression().
    com.google.gson.JsonElement visitVariable​(com.walkfares.odsl.grammar.OpenDSLParser.VariableContext ctx)
    Visit a parse tree produced by OpenDSLParser.variable().
    com.google.gson.JsonElement visitVarname​(com.walkfares.odsl.grammar.OpenDSLParser.VarnameContext ctx)
    Visit a parse tree produced by OpenDSLParser.varname().

    Methods inherited from class com.walkfares.odsl.grammar.OpenDSLBaseVisitor

    visitAbort, visitAction, visitActionExit, visitActionInput, visitActionOutput, visitActivevar, visitAddField, visitAggregate, visitAggregationOptions, visitAggregationPipeline, visitArray, visitArraycondition, visitArrayinitialiser, visitAssign, visitAssignee, visitAvservice, visitBucketOutput, visitComment, visitConditionalExpression, visitControl, visitCreateIndex, visitDate, visitDateexpression, visitDeclaredType, visitDelete, visitDeleteBulk, visitDynamicname, visitErrors, visitErrorText, visitExponentExpression, visitExpression, visitExpressionOrCondition, visitExtract, visitExtractCheck, visitExtractClick, visitExtractFill, visitExtractor, visitExtractParam, visitExtractSelect, visitFacetItem, visitFail, visitFind, visitFoldingrange, visitForeach, visitForstmt, visitFunction, visitFunctionbody, visitFunctionparam, visitGranularity, visitGroupAssign, visitIfstmt, visitImportscript, visitIndexcollation, visitIndexcollationitem, visitIndexfield, visitIndexoptions, visitIndexpartial, visitIndexttl, visitJsonElement, visitLink, visitLinkType, visitLog, visitLogout, visitMethodbody, visitMlVarname, visitNl, visitObjectDeclaration, visitObjectDefinition, visitPhase, visitPipelineAddFields, visitPipelineBucket, visitPipelineBucketauto, visitPipelineCount, visitPipelineDocuments, visitPipelineFacet, visitPipelineGeoNear, visitPipelineGraphLookup, visitPipelineGroup, visitPipelineItem, visitPipelineLimit, visitPipelineLookup, visitPipelineMatch, visitPipelineMerge, visitPipelineOperator, visitPipelineOut, visitPipelineProject, visitPipelineRedact, visitPipelineReplaceRoot, visitPipelineReplaceWith, visitPipelineSample, visitPipelineSkip, visitPipelineSort, visitPipelineSortByCount, visitPipelineUnwind, visitPprojectField, visitPrint, visitProject, visitProjectField, visitProperty, visitPublicvar, visitPublish, visitQualityCheck, visitQualityCheckProfile, visitQualityCheckProfileParams, visitQualityCheckWithChecks, visitRelationalExpression, visitRename, visitReschedule, visitReturnstmt, visitRun, visitSave, visitScalarvar, visitSend, visitSendmail, visitSet, visitSingleLineIfExpression, visitSingleLineIfStatement, visitSortItem, visitStart, visitStatement, visitTagstmt, visitThrowerror, visitTransform, visitTransformClear, visitTransformCreate, visitTransformer, visitTransformFor, visitTransformIf, visitTransformIgnore, visitTransformOptions, visitTransformUnique, visitTrigger, visitTypeBucket, visitTypeConstraint, visitTypeDeclaration, visitTypeDefinition, visitTypeEditor, visitTypeExpression, visitTypeMethod, visitTypeMethodParams, visitTypeProperty, visitTypeSmartData, visitUpdateBulk, visitUpdateOperator, visitUpdateOperatorParam, visitUse, visitVersion, visitWaitcmd, visitWhilestmt, visitWorkflow, visitWorkflowAction, visitWorkflowBody, visitWorkflowEvent, visitWorkflowGateway, visitWorkflowStart, visitWorkflowTransition, visitWorkflowWorkflow

    Methods inherited from class org.antlr.v4.runtime.tree.AbstractParseTreeVisitor

    visit, visitChildren, visitErrorNode, visitTerminal

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.antlr.v4.runtime.tree.ParseTreeVisitor

    visit, visitChildren, visitErrorNode, visitTerminal
  • Constructor Details

  • Method Details

    • parse

      public com.google.gson.JsonElement parse​(String condition)
    • createFilter

      public com.google.gson.JsonElement createFilter​(List<com.walkfares.odsl.grammar.OpenDSLParser.ConditionContext> logicCondition)
    • createObjectFilter

      public com.google.gson.JsonElement createObjectFilter​(List<com.walkfares.odsl.grammar.OpenDSLParser.ConditionContext> logicCondition)
    • visitAddingExpression

      public com.google.gson.JsonElement visitAddingExpression​(com.walkfares.odsl.grammar.OpenDSLParser.AddingExpressionContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.addingExpression().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitAddingExpression in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitAddingExpression in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitMultiplyExpression

      public com.google.gson.JsonElement visitMultiplyExpression​(com.walkfares.odsl.grammar.OpenDSLParser.MultiplyExpressionContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.multiplyExpression().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitMultiplyExpression in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitMultiplyExpression in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitSingularExpression

      public com.google.gson.JsonElement visitSingularExpression​(com.walkfares.odsl.grammar.OpenDSLParser.SingularExpressionContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.singularExpression().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitSingularExpression in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitSingularExpression in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitCondition

      public com.google.gson.JsonElement visitCondition​(com.walkfares.odsl.grammar.OpenDSLParser.ConditionContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.condition().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitCondition in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitCondition in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitFunctioncall

      public com.google.gson.JsonElement visitFunctioncall​(com.walkfares.odsl.grammar.OpenDSLParser.FunctioncallContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.functioncall().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitFunctioncall in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitFunctioncall in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitUnevaluatedExpression

      public com.google.gson.JsonElement visitUnevaluatedExpression​(com.walkfares.odsl.grammar.OpenDSLParser.UnevaluatedExpressionContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.unevaluatedExpression().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitUnevaluatedExpression in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitUnevaluatedExpression in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitArrayexpression

      public com.google.gson.JsonElement visitArrayexpression​(com.walkfares.odsl.grammar.OpenDSLParser.ArrayexpressionContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.arrayexpression().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitArrayexpression in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitArrayexpression in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitRowexpression

      public com.google.gson.JsonElement visitRowexpression​(com.walkfares.odsl.grammar.OpenDSLParser.RowexpressionContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.rowexpression().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitRowexpression in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitRowexpression in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitVariable

      public com.google.gson.JsonElement visitVariable​(com.walkfares.odsl.grammar.OpenDSLParser.VariableContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.variable().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitVariable in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitVariable in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitVarname

      public com.google.gson.JsonElement visitVarname​(com.walkfares.odsl.grammar.OpenDSLParser.VarnameContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.varname().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitVarname in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitVarname in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitId

      public com.google.gson.JsonElement visitId​(com.walkfares.odsl.grammar.OpenDSLParser.IdContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.id().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitId in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitId in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitNumber

      public com.google.gson.JsonElement visitNumber​(com.walkfares.odsl.grammar.OpenDSLParser.NumberContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.number().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitNumber in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitNumber in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitJsonObject

      public com.google.gson.JsonElement visitJsonObject​(com.walkfares.odsl.grammar.OpenDSLParser.JsonObjectContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.jsonObject().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitJsonObject in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitJsonObject in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitInteger

      public com.google.gson.JsonElement visitInteger​(com.walkfares.odsl.grammar.OpenDSLParser.IntegerContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.integer().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitInteger in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitInteger in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitTf

      public com.google.gson.JsonElement visitTf​(com.walkfares.odsl.grammar.OpenDSLParser.TfContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.tf().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitTf in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitTf in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitString

      public com.google.gson.JsonElement visitString​(com.walkfares.odsl.grammar.OpenDSLParser.StringContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.string().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitString in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitString in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitMethod

      public com.google.gson.JsonElement visitMethod​(com.walkfares.odsl.grammar.OpenDSLParser.MethodContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.method().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitMethod in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitMethod in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result
    • visitArrayindex

      public com.google.gson.JsonElement visitArrayindex​(com.walkfares.odsl.grammar.OpenDSLParser.ArrayindexContext ctx)
      Description copied from class: com.walkfares.odsl.grammar.OpenDSLBaseVisitor
      Visit a parse tree produced by OpenDSLParser.arrayindex().

      The default implementation returns the result of calling AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) on ctx.

      Specified by:
      visitArrayindex in interface com.walkfares.odsl.grammar.OpenDSLVisitor<com.google.gson.JsonElement>
      Overrides:
      visitArrayindex in class com.walkfares.odsl.grammar.OpenDSLBaseVisitor<com.google.gson.JsonElement>
      Parameters:
      ctx - the parse tree
      Returns:
      the visitor result