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.StringclassNameprivate java.util.Set<MethodInfo>constructorsprivate java.util.Map<java.lang.String,FieldInfo>fieldsprivate booleanhashIsCachedprivate inthashValueprivate java.util.List<Type>implsprivate booleaninitCompleteprivate booleanisInterfaceprivate java.util.Map<java.lang.String,java.util.Set<MethodInfo>>methodInfoByNameprivate intmodifiersprivate java.lang.StringpkgNameprivate TypesuperTypeprivate TypethisType
-
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 voidaddConstructorInfo(MethodInfo cinfo)protected voidaddFieldInfo(FieldInfo finfo)protected voidaddMethodInfo(MethodInfo minfo)private voidcheckComplete()private voidcheckReinitialize()java.lang.StringclassName()Return the class name of the class represented by this ClassInfo relative to pkgName().private voidclearHashCode()java.util.Set<MethodInfo>constructorInfo()booleanequals(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).MethodInfofindConstructorInfo(Signature sig)Find the MethodInfo (if any) for a Constructor with the given Signature in this ClassInfo.FieldInfofindFieldInfo(java.lang.String name)Find a field with the given name if one exists.MethodInfofindMethodInfo(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 MethodInfofindMethodInfo(Signature sig, java.util.Set<MethodInfo> minfos)inthashCode()java.util.List<Type>impls()Return the list of Types of interfaces implemented by this class.protected voidinitializeClass(Type thisType, Type superType, java.util.List<Type> impls)protected voidinitializeInterface(java.util.List<Type> exts)booleanisInterface()Return true iff this ClassInfo is an interface.booleanisSubclass(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.intmodifiers()Return the modifiers on this class as specified in java.lang.reflect.Modifier.java.lang.Stringname()Return the fully qualified class name for this ClassInfo.java.lang.StringpkgName()Return the fully qualified package name containing the class represented by this ClassInfo.TypesuperType()Return the Type of the supertype of this class.TypethisType()Return the Type of the class represented by this ClassInfo.java.lang.StringtoString()
-
-
-
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:ClassInfoReturn the Type of the class represented by this ClassInfo.
-
isInterface
public boolean isInterface()
Description copied from interface:ClassInfoReturn true iff this ClassInfo is an interface.- Specified by:
isInterfacein interfaceClassInfo
-
modifiers
public int modifiers()
Description copied from interface:ClassInfoReturn the modifiers on this class as specified in java.lang.reflect.Modifier.
-
name
public java.lang.String name()
Description copied from interface:ClassInfoReturn the fully qualified class name for this ClassInfo.
-
className
public java.lang.String className()
Description copied from interface:ClassInfoReturn the class name of the class represented by this ClassInfo relative to pkgName().
-
pkgName
public java.lang.String pkgName()
Description copied from interface:ClassInfoReturn the fully qualified package name containing the class represented by this ClassInfo.
-
superType
public Type superType()
Description copied from interface:ClassInfoReturn the Type of the supertype of this class.
-
impls
public java.util.List<Type> impls()
Description copied from interface:ClassInfoReturn 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:ClassInfoReturn 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:ClassInfoFind a field with the given name if one exists. Searches this class and all super classes.- Specified by:
findFieldInfoin interfaceClassInfo
-
methodInfoByName
public java.util.Map<java.lang.String,java.util.Set<MethodInfo>> methodInfoByName()
Description copied from interface:ClassInfoReturn 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:
methodInfoByNamein interfaceClassInfo
-
constructorInfo
public java.util.Set<MethodInfo> constructorInfo()
- Specified by:
constructorInfoin 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:ClassInfoFind the method (if any) with the given name and Signature in this ClassInfo, or in any superType of this ClassInfo.- Specified by:
findMethodInfoin interfaceClassInfo
-
findConstructorInfo
public MethodInfo findConstructorInfo(Signature sig)
Description copied from interface:ClassInfoFind the MethodInfo (if any) for a Constructor with the given Signature in this ClassInfo.- Specified by:
findConstructorInfoin interfaceClassInfo
-
isSubclass
public boolean isSubclass(ClassInfo info)
Description copied from interface:ClassInfoReturn true iff this is a subclass or subinterface of info.- Specified by:
isSubclassin interfaceClassInfo
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
clearHashCode
private void clearHashCode()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-