Class ClassExpr

All Implemented Interfaces:
NodeWithRange<Node>, NodeWithTokenRange<Node>, NodeWithType<ClassExpr,​Type>, Observable, Visitable, HasParentNode<Node>, Cloneable

public class ClassExpr extends Expression implements NodeWithType<ClassExpr,​Type>
Defines an expression that accesses the class of a type.
Object.class
Author:
Julio Vilmar Gesser
  • Constructor Details

    • ClassExpr

      public ClassExpr()
    • ClassExpr

      public ClassExpr(Type type)
    • ClassExpr

      public ClassExpr(TokenRange tokenRange, Type type)
      This constructor is used by the parser and is considered private.
  • Method Details

    • accept

      public <R,​ A> R accept(GenericVisitor<R,​A> v, A arg)
      Description copied from interface: Visitable
      Accept method for visitor support.
      Specified by:
      accept in interface Visitable
      Type Parameters:
      R - the type of the return value of the visitor
      A - the type the user argument passed to the visitor
      Parameters:
      v - the visitor implementation
      arg - the argument passed to the visitor (of type A)
      Returns:
      the result of the visit (of type R)
    • accept

      public <A> void accept(VoidVisitor<A> v, A arg)
      Description copied from interface: Visitable
      Accept method for visitor support.
      Specified by:
      accept in interface Visitable
      Type Parameters:
      A - the type the argument passed for the visitor
      Parameters:
      v - the visitor implementation
      arg - any value relevant for the visitor (of type A)
    • getType

      public Type getType()
      Description copied from interface: NodeWithType
      Gets the type
      Specified by:
      getType in interface NodeWithType<ClassExpr,​Type>
      Returns:
      the type
    • setType

      public ClassExpr setType(Type type)
      Description copied from interface: NodeWithType
      Sets the type
      Specified by:
      setType in interface NodeWithType<ClassExpr,​Type>
      Parameters:
      type - the type
      Returns:
      this
    • clone

      public ClassExpr clone()
      Overrides:
      clone in class Expression
    • getMetaModel

      public ClassExprMetaModel getMetaModel()
      Overrides:
      getMetaModel in class Expression
      Returns:
      get JavaParser specific node introspection information.
    • replace

      public boolean replace(Node node, Node replacementNode)
      Overrides:
      replace in class Node
    • isClassExpr

      public boolean isClassExpr()
      Overrides:
      isClassExpr in class Expression
    • asClassExpr

      public ClassExpr asClassExpr()
      Overrides:
      asClassExpr in class Expression
    • ifClassExpr

      public void ifClassExpr(Consumer<ClassExpr> action)
      Overrides:
      ifClassExpr in class Expression
    • toClassExpr

      public Optional<ClassExpr> toClassExpr()
      Overrides:
      toClassExpr in class Expression