org.glassfish.pfl.dynamic.codegen.impl
Class ClassInfoBase

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

public abstract class ClassInfoBase
extends Object
implements ClassInfo


Constructor Summary
ClassInfoBase(int modifiers, Type thisType)
          Construct a ClassInfoBase representing a class or interface.
 
Method Summary
protected  void addConstructorInfo(MethodInfo cinfo)
           
protected  void addFieldInfo(FieldInfo finfo)
           
protected  void addMethodInfo(MethodInfo minfo)
           
 String className()
          Return the class name of the class represented by this ClassInfo relative to pkgName().
 Set<MethodInfo> constructorInfo()
           
 boolean equals(Object obj)
           
 Map<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(String name)
          Find a field with the given name if one exists.
 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.
 int hashCode()
           
 List<Type> impls()
          Return the list of Types of interfaces implemented by this class.
protected  void initializeClass(Type thisType, Type superType, List<Type> impls)
           
protected  void initializeInterface(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.
 Map<String,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.
 String name()
          Return the fully qualified class name for this ClassInfo.
 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassInfoBase

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

Method Detail

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

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2013 Oracle. All Rights Reserved.