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 java.lang.Object implements ClassInfo
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
className
private java.util.Set<MethodInfo>
constructors
private java.util.Map<java.lang.String,FieldInfo>
fields
private boolean
hashIsCached
private int
hashValue
private java.util.List<Type>
impls
private boolean
initComplete
private boolean
isInterface
private java.util.Map<java.lang.String,java.util.Set<MethodInfo>>
methodInfoByName
private int
modifiers
private java.lang.String
pkgName
private Type
superType
private Type
thisType
-
Constructor Summary
Constructors Constructor Description ClassInfoBase(int modifiers, Type thisType)
Construct a ClassInfoBase representing a class or interface.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addConstructorInfo(MethodInfo cinfo)
protected void
addFieldInfo(FieldInfo finfo)
protected void
addMethodInfo(MethodInfo minfo)
private void
checkComplete()
private void
checkReinitialize()
java.lang.String
className()
Return the class name of the class represented by this ClassInfo relative to pkgName().private void
clearHashCode()
java.util.Set<MethodInfo>
constructorInfo()
boolean
equals(java.lang.Object obj)
java.util.Map<java.lang.String,FieldInfo>
fieldInfo()
Return a map from field names to FieldInfo instances for every field defined in this class (not including super types).MethodInfo
findConstructorInfo(Signature sig)
Find the MethodInfo (if any) for a Constructor with the given Signature in this ClassInfo.FieldInfo
findFieldInfo(java.lang.String name)
Find a field with the given name if one exists.MethodInfo
findMethodInfo(java.lang.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.private MethodInfo
findMethodInfo(Signature sig, java.util.Set<MethodInfo> minfos)
int
hashCode()
java.util.List<Type>
impls()
Return the list of Types of interfaces implemented by this class.protected void
initializeClass(Type thisType, Type superType, java.util.List<Type> impls)
protected void
initializeInterface(java.util.List<Type> exts)
boolean
isInterface()
Return true iff this ClassInfo is an interface.boolean
isSubclass(ClassInfo info)
Return true iff this is a subclass or subinterface of info.java.util.Map<java.lang.String,java.util.Set<MethodInfo>>
methodInfoByName()
Return methodInfo for all methods defined on this class.int
modifiers()
Return the modifiers on this class as specified in java.lang.reflect.Modifier.java.lang.String
name()
Return the fully qualified class name for this ClassInfo.java.lang.String
pkgName()
Return the fully qualified package name containing the class represented by this ClassInfo.Type
superType()
Return the Type of the supertype of this class.Type
thisType()
Return the Type of the class represented by this ClassInfo.java.lang.String
toString()
-
-
-
Field Detail
-
modifiers
private int modifiers
-
thisType
private Type thisType
-
className
private java.lang.String className
-
pkgName
private java.lang.String pkgName
-
initComplete
private boolean initComplete
-
isInterface
private boolean isInterface
-
superType
private Type superType
-
impls
private java.util.List<Type> impls
-
methodInfoByName
private java.util.Map<java.lang.String,java.util.Set<MethodInfo>> methodInfoByName
-
constructors
private java.util.Set<MethodInfo> constructors
-
fields
private java.util.Map<java.lang.String,FieldInfo> fields
-
hashIsCached
private boolean hashIsCached
-
hashValue
private int hashValue
-
-
Constructor Detail
-
ClassInfoBase
public ClassInfoBase(int modifiers, Type thisType)
Construct a ClassInfoBase representing a class or interface.
-
-
Method Detail
-
checkComplete
private void checkComplete()
-
checkReinitialize
private void checkReinitialize()
-
initializeInterface
protected void initializeInterface(java.util.List<Type> exts)
-
initializeClass
protected void initializeClass(Type thisType, Type superType, java.util.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.
-
isInterface
public boolean isInterface()
Description copied from interface:ClassInfo
Return true iff this ClassInfo is an interface.- Specified by:
isInterface
in interfaceClassInfo
-
modifiers
public int modifiers()
Description copied from interface:ClassInfo
Return the modifiers on this class as specified in java.lang.reflect.Modifier.
-
name
public java.lang.String name()
Description copied from interface:ClassInfo
Return the fully qualified class name for this ClassInfo.
-
className
public java.lang.String className()
Description copied from interface:ClassInfo
Return the class name of the class represented by this ClassInfo relative to pkgName().
-
pkgName
public java.lang.String pkgName()
Description copied from interface:ClassInfo
Return the fully qualified package name containing the class represented by this ClassInfo.
-
superType
public Type superType()
Description copied from interface:ClassInfo
Return the Type of the supertype of this class.
-
impls
public java.util.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.
-
fieldInfo
public java.util.Map<java.lang.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).
-
findFieldInfo
public FieldInfo findFieldInfo(java.lang.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 interfaceClassInfo
-
methodInfoByName
public java.util.Map<java.lang.String,java.util.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 interfaceClassInfo
-
constructorInfo
public java.util.Set<MethodInfo> constructorInfo()
- Specified by:
constructorInfo
in interfaceClassInfo
-
findMethodInfo
private MethodInfo findMethodInfo(Signature sig, java.util.Set<MethodInfo> minfos)
-
findMethodInfo
public MethodInfo findMethodInfo(java.lang.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 interfaceClassInfo
-
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 interfaceClassInfo
-
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 interfaceClassInfo
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
clearHashCode
private void clearHashCode()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-