Interface CtTypeAccess<A>

  • Type Parameters:
    A - Access type of the expression.
    All Superinterfaces:
    java.lang.Cloneable, CtCodeElement, CtElement, CtExpression<java.lang.Void>, CtQueryable, CtTypedElement<java.lang.Void>, CtVisitable, FactoryAccessor, java.io.Serializable, SourcePositionHolder, TemplateParameter<java.lang.Void>
    All Known Implementing Classes:
    CtTypeAccessImpl

    public interface CtTypeAccess<A>
    extends CtExpression<java.lang.Void>
    This code element represents a type reference usable as an expression. It is used in particular for static accesses, Java 8 method references, instanceof binary expressions and ".class".
         // access to static field
         java.io.PrintStream ps = System.out;
     
         // call to static method
         Class.forName("Foo")
     
         // method reference
         java.util.function.Supplier p =
           Object::new;
     
         // instanceof test
         boolean x = new Object() instanceof Integer // Integer is represented as an access to type Integer
     
         // fake field "class"
         Class x = Number.class