Class ClassInfoBase

java.lang.Object
org.glassfish.pfl.dynamic.codegen.impl.ClassInfoBase
All Implemented Interfaces:
ClassInfo
Direct Known Subclasses:
ClassGeneratorImpl, ClassInfoReflectiveImpl

public abstract class ClassInfoBase extends Object implements ClassInfo
  • Field Details

    • modifiers

      private int modifiers
    • thisType

      private Type thisType
    • className

      private String className
    • pkgName

      private String pkgName
    • initComplete

      private boolean initComplete
    • isInterface

      private boolean isInterface
    • superType

      private Type superType
    • impls

      private List<Type> impls
    • methodInfoByName

      private Map<String,Set<MethodInfo>> methodInfoByName
    • constructors

      private Set<MethodInfo> constructors
    • fields

      private Map<String,FieldInfo> fields
    • hashIsCached

      private boolean hashIsCached
    • hashValue

      private int hashValue
  • Constructor Details

    • ClassInfoBase

      public ClassInfoBase(int modifiers, Type thisType)
      Construct a ClassInfoBase representing a class or interface.
  • Method Details

    • checkComplete

      private void checkComplete()
    • checkReinitialize

      private void checkReinitialize()
    • initializeInterface

      protected void initializeInterface(List<Type> exts)
    • initializeClass

      protected void initializeClass(Type thisType, Type superType, List<Type> impls)
    • addFieldInfo

      protected void addFieldInfo(FieldInfo finfo)
    • addMethodInfo

      protected void addMethodInfo(MethodInfo minfo)
    • addConstructorInfo

      protected void addConstructorInfo(MethodInfo cinfo)
    • thisType

      public Type thisType()
      Description copied from interface: ClassInfo
      Return the Type of the class represented by this ClassInfo.
      Specified by:
      thisType in interface ClassInfo
    • isInterface

      public boolean isInterface()
      Description copied from interface: ClassInfo
      Return true iff this ClassInfo is an interface.
      Specified by:
      isInterface in interface ClassInfo
    • modifiers

      public int modifiers()
      Description copied from interface: ClassInfo
      Return the modifiers on this class as specified in java.lang.reflect.Modifier.
      Specified by:
      modifiers in interface ClassInfo
    • name

      public String name()
      Description copied from interface: ClassInfo
      Return the fully qualified class name for this ClassInfo.
      Specified by:
      name in interface ClassInfo
    • className

      public String className()
      Description copied from interface: ClassInfo
      Return the class name of the class represented by this ClassInfo relative to pkgName().
      Specified by:
      className in interface ClassInfo
    • pkgName

      public String pkgName()
      Description copied from interface: ClassInfo
      Return the fully qualified package name containing the class represented by this ClassInfo.
      Specified by:
      pkgName in interface ClassInfo
    • superType

      public Type superType()
      Description copied from interface: ClassInfo
      Return the Type of the supertype of this class.
      Specified by:
      superType in interface ClassInfo
    • impls

      public List<Type> impls()
      Description copied from interface: ClassInfo
      Return the list of Types of interfaces implemented by this class. May be empty, but never null.
      Specified by:
      impls in interface ClassInfo
    • fieldInfo

      public Map<String,FieldInfo> fieldInfo()
      Description copied from interface: ClassInfo
      Return a map from field names to FieldInfo instances for every field defined in this class (not including super types).
      Specified by:
      fieldInfo in interface ClassInfo
    • findFieldInfo

      public FieldInfo findFieldInfo(String name)
      Description copied from interface: ClassInfo
      Find a field with the given name if one exists. Searches this class and all super classes.
      Specified by:
      findFieldInfo in interface ClassInfo
    • methodInfoByName

      public Map<String,Set<MethodInfo>> methodInfoByName()
      Description copied from interface: ClassInfo
      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.
      Specified by:
      methodInfoByName in interface ClassInfo
    • constructorInfo

      public Set<MethodInfo> constructorInfo()
      Specified by:
      constructorInfo in interface ClassInfo
    • findMethodInfo

      private MethodInfo findMethodInfo(Signature sig, Set<MethodInfo> minfos)
    • findMethodInfo

      public MethodInfo findMethodInfo(String name, Signature sig)
      Description copied from interface: ClassInfo
      Find the method (if any) with the given name and Signature in this ClassInfo, or in any superType of this ClassInfo.
      Specified by:
      findMethodInfo in interface ClassInfo
    • findConstructorInfo

      public MethodInfo findConstructorInfo(Signature sig)
      Description copied from interface: ClassInfo
      Find the MethodInfo (if any) for a Constructor with the given Signature in this ClassInfo.
      Specified by:
      findConstructorInfo in interface ClassInfo
    • isSubclass

      public boolean isSubclass(ClassInfo info)
      Description copied from interface: ClassInfo
      Return true iff this is a subclass or subinterface of info.
      Specified by:
      isSubclass in interface ClassInfo
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clearHashCode

      private void clearHashCode()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object