Interface ClassInfo

All Known Subinterfaces:
ClassGenerator, ModifiableClass
All Known Implementing Classes:
ClassGeneratorImpl, ClassInfoBase, ClassInfoReflectiveImpl

public interface ClassInfo
An interface that provides information about classes. This can be used to describe both ClassGenerators that are used to generate code and pre-existing Java classes.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the class name of the class represented by this ClassInfo relative to pkgName().
     
    Return a map from field names to FieldInfo instances for every field defined in this class (not including super types).
    Find the MethodInfo (if any) for a Constructor with the given Signature in this ClassInfo.
    Find a field with the given name if one exists.
    Find the method (if any) with the given name and Signature in this ClassInfo, or in any superType of this ClassInfo.
    Return the list of Types of interfaces implemented by this class.
    boolean
    Return true iff this ClassInfo is an interface.
    boolean
    Return true iff this is a subclass or subinterface of info.
    Return methodInfo for all methods defined on this class.
    int
    Return the modifiers on this class as specified in java.lang.reflect.Modifier.
    Return the fully qualified class name for this ClassInfo.
    Return the fully qualified package name containing the class represented by this ClassInfo.
    Return the Type of the supertype of this class.
    Return the Type of the class represented by this ClassInfo.
  • Method Details

    • modifiers

      int modifiers()
      Return the modifiers on this class as specified in java.lang.reflect.Modifier.
    • thisType

      Type thisType()
      Return the Type of the class represented by this ClassInfo.
    • isInterface

      boolean isInterface()
      Return true iff this ClassInfo is an interface.
    • name

      String name()
      Return the fully qualified class name for this ClassInfo.
    • pkgName

      String pkgName()
      Return the fully qualified package name containing the class represented by this ClassInfo.
    • className

      String className()
      Return the class name of the class represented by this ClassInfo relative to pkgName().
    • superType

      Type superType()
      Return the Type of the supertype of this class.
    • impls

      List<Type> impls()
      Return the list of Types of interfaces implemented by this class. May be empty, but never null.
    • fieldInfo

      Map<String, FieldInfo> fieldInfo()
      Return a map from field names to FieldInfo instances for every field defined in this class (not including super types).
    • findFieldInfo

      FieldInfo findFieldInfo(String name)
      Find a field with the given name if one exists. Searches this class and all super classes.
    • methodInfoByName

      Map<String, Set<MethodInfo>> methodInfoByName()
      Return methodInfo for all methods defined on this class. This does not include inherited methods. Here we return a map from method name to the set of MethodInfo instances for all methods with the same method name. This form is useful for handling method overload resolution.
    • constructorInfo

      Set<MethodInfo> constructorInfo()
    • findMethodInfo

      MethodInfo findMethodInfo(String name, Signature sig)
      Find the method (if any) with the given name and Signature in this ClassInfo, or in any superType of this ClassInfo.
    • findConstructorInfo

      MethodInfo findConstructorInfo(Signature sig)
      Find the MethodInfo (if any) for a Constructor with the given Signature in this ClassInfo.
    • isSubclass

      boolean isSubclass(ClassInfo info)
      Return true iff this is a subclass or subinterface of info.