Interface Visitable

All Known Subinterfaces:
Case, Case.CaseEnding, Case.GenericCase, Case.SimpleCase, Clause, Condition, Expression, Literal<T>, Node, PatternElement, ProcedureCall, Property, QuantifiedPathPattern.Quantifier, Relationship, RelationshipPattern, ResultStatement, Statement, Statement.RegularQuery, Statement.SingleQuery, Statement.UnionQuery, Statement.UseStatement, SubqueryExpression, UpdatingClause, Use
All Known Implementing Classes:
AliasedExpression, Asterisk, BooleanLiteral, CollectExpression, Comparison, ConstantCondition, CountExpression, Create, Delete, ExistentialSubquery, Foreach, FunctionInvocation, HasLabelCondition, Hint, InTransactions, KeyValueMapEntry, LabelExpression, Limit, ListComprehension, ListExpression, ListLiteral, ListOperator, MapExpression, MapLiteral, MapProjection, Match, Merge, MergeAction, NamedPath, NestedExpression, NodeBase, NodeLabel, NullLiteral, NumberLiteral, Operation, Operator, Order, Parameter, ParenthesizedPathPattern, PatternComprehension, Properties, PropertyLookup, QuantifiedPathPattern, QuantifiedPathPattern.TargetPattern, Reduction, Relationship.Details, RelationshipBase, RelationshipChain, Remove, Return, ReturnBody, Set, Skip, SortItem, SortItem.Direction, StringLiteral, Subquery, SymbolicName, TemporalLiteral, TypedSubtree, UnionPart, Unwind, Where, With

public interface Visitable
Interface for implementations that accepts visitors.
Since:
1.0
Author:
Michael Simons
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    accept(Visitor visitor)
    Accept a Visitor visiting this Visitable and its nested Visitables if applicable.
    Most visitables will render themselves into a Cypher fragment preceded with the actual classname.
    static void
    visitIfNotNull(Visitable visitable, Visitor visitor)
    A helper method that presents the visitor to the visitable if the visitable is not null.
  • Method Details

    • visitIfNotNull

      static void visitIfNotNull(Visitable visitable, Visitor visitor)
      A helper method that presents the visitor to the visitable if the visitable is not null. Not meant to be overridden.
      Parameters:
      visitable - The visitable to visit if not null
      visitor - The visitor to use
    • accept

      default void accept(Visitor visitor)
      Accept a Visitor visiting this Visitable and its nested Visitables if applicable.
      Parameters:
      visitor - the visitor to notify, must not be null.
    • toString

      String toString()
      Most visitables will render themselves into a Cypher fragment preceded with the actual classname. The representation however is not cached - in contrast to the ones for full statements. Using toString is recommended for debugging purposes mainly, and not for production use.

      The concrete classname has been prepended to help debugging and actually to discourage using fragments to build queries without explicitly rendering them, either as statement or going through the renderer on purpose.

      Overrides:
      toString in class Object
      Returns:
      A string representation of this visitable formatted as Classname{cypher=value}