Interface Visitable

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void accept​(Visitor visitor)
      Accept a Visitor and invoke the appropriate visit methods.
      void accept​(java.lang.String elementName, int elementIndex, Visitor visitor)
      Accept a Visitor and invoke the appropriate visit methods.
      default void accept​(java.lang.String elementName, Visitor visitor)
      Accept a Visitor and invoke the appropriate visit methods.
    • Method Detail

      • accept

        void accept​(java.lang.String elementName,
                    int elementIndex,
                    Visitor visitor)
        Accept a Visitor and invoke the appropriate visit methods. A typical implementation would look like this:
         if (visitor.preVisit(this)) {
             visitor.visitStart(elementName, elementIndex, this);
             if (visitor.visit(elementName, elementIndex, this)) {
                 // visit children
             }
             visitor.visitEnd(elementName, elementIndex, this);
             visitor.postVisit(this);
         }
         
        Parameters:
        elementName - the name of the element in the context of this visit
        elementIndex - the index of the element in a list or -1 if it is not contained within a List
        visitor - the visitor to use
      • accept

        default void accept​(java.lang.String elementName,
                            Visitor visitor)
        Accept a Visitor and invoke the appropriate visit methods. This variant assumes that the element is not within a list.
        Parameters:
        elementName - the name of the element in the context of this visit
        visitor - the visitor to use
      • accept

        default void accept​(Visitor visitor)
        Accept a Visitor and invoke the appropriate visit methods. This variant uses ModelSupport to infer the name of element being visited and assumes the element is not within a list.
        Parameters:
        visitor - the visitor to use