Top Fields Constructors Methods
org.glassfish.pfl.dynamic.codegen.impl

public abstract Class ClassInfoBase

extends Object
implements ClassInfo
Class Inheritance
All Implemented Interfaces
org.glassfish.pfl.dynamic.codegen.spi.ClassInfo
Known Direct Subclasses
org.glassfish.pfl.dynamic.codegen.impl.ClassInfoReflectiveImpl, org.glassfish.pfl.dynamic.codegen.impl.ClassGeneratorImpl
Imports
java.lang.reflect.Modifier, java.util.HashSet, .LinkedHashMap, .List, .Map, .Set, org.glassfish.pfl.dynamic.codegen.spi.ClassInfo, .FieldInfo, .MethodInfo, .Signature, .Type

Field Summary

Modifier and TypeField and Description
private String
private Set<MethodInfo>
private Map<String, FieldInfo>
private boolean
private int
private List<Type>
private boolean
private boolean
private Map<String, Set<MethodInfo>>
private int
private String
private Type
private Type

Constructor Summary

AccessConstructor and Description
public
ClassInfoBase(int modifiers, Type thisType)

Construct a ClassInfoBase representing a class or interface.

Method Summary

Modifier and TypeMethod and Description
protected void
protected void
protected void
private void
private void
public String
className()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.className.

Return the class name of the class represented by this ClassInfo relative to pkgName().

private synchronized void
public Set<MethodInfo>
public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public Map<String, FieldInfo>
fieldInfo()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.fieldInfo.

Return a map from field names to FieldInfo instances for every field defined in this class (not including super types).

public MethodInfo
findConstructorInfo(Signature sig)

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.findConstructorInfo.

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

public FieldInfo
findFieldInfo(String name)

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.findFieldInfo.

Find a field with the given name if one exists.

private MethodInfo
public MethodInfo
findMethodInfo(String name, Signature sig)

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.findMethodInfo.

Find the method (if any) with the given name and Signature in this ClassInfo, or in any superType of this ClassInfo.

public synchronized int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public List<Type>
impls()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.impls.

Return the list of Types of interfaces implemented by this class.

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

protected void
public boolean
isInterface()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.isInterface.

Return true iff this ClassInfo is an interface.

public boolean
isSubclass(ClassInfo info)

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.isSubclass.

Return true iff this is a subclass or subinterface of info.

public Map<String, Set<MethodInfo>>
methodInfoByName()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.methodInfoByName.

Return methodInfo for all methods defined on this class.

public int
modifiers()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.modifiers.

Return the modifiers on this class as specified in java.lang.reflect.Modifier.

public String
name()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.name.

Return the fully qualified class name for this ClassInfo.

public String
pkgName()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.pkgName.

Return the fully qualified package name containing the class represented by this ClassInfo.

public Type
superType()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.superType.

Return the Type of the supertype of this class.

public Type
thisType()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.thisType.

Return the Type of the class represented by this ClassInfo.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

classNameback to summary
private String className
constructorsback to summary
private Set<MethodInfo> constructors
fieldsback to summary
private Map<String, FieldInfo> fields
hashIsCachedback to summary
private boolean hashIsCached
hashValueback to summary
private int hashValue
implsback to summary
private List<Type> impls
initCompleteback to summary
private boolean initComplete
isInterfaceback to summary
private boolean isInterface
methodInfoByNameback to summary
private Map<String, Set<MethodInfo>> methodInfoByName
modifiersback to summary
private int modifiers
pkgNameback to summary
private String pkgName
superTypeback to summary
private Type superType
thisTypeback to summary
private Type thisType

Constructor Detail

ClassInfoBaseback to summary
public ClassInfoBase(int modifiers, Type thisType)

Construct a ClassInfoBase representing a class or interface.

Method Detail

addConstructorInfoback to summary
protected void addConstructorInfo(MethodInfo cinfo)
addFieldInfoback to summary
protected void addFieldInfo(FieldInfo finfo)
addMethodInfoback to summary
protected void addMethodInfo(MethodInfo minfo)
checkCompleteback to summary
private void checkComplete()
checkReinitializeback to summary
private void checkReinitialize()
classNameback to summary
public String className()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.className.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.className.

Return the class name of the class represented by this ClassInfo relative to pkgName().

clearHashCodeback to summary
private synchronized void clearHashCode()
constructorInfoback to summary
public Set<MethodInfo> constructorInfo()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.constructorInfo.

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

fieldInfoback to summary
public Map<String, FieldInfo> fieldInfo()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.fieldInfo.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.fieldInfo.

Return a map from field names to FieldInfo instances for every field defined in this class (not including super types).

findConstructorInfoback to summary
public MethodInfo findConstructorInfo(Signature sig)

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.findConstructorInfo.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.findConstructorInfo.

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

findFieldInfoback to summary
public FieldInfo findFieldInfo(String name)

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.findFieldInfo.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.findFieldInfo.

Find a field with the given name if one exists. Searches this class and all super classes.

findMethodInfoback to summary
private MethodInfo findMethodInfo(Signature sig, Set<MethodInfo> minfos)
findMethodInfoback to summary
public MethodInfo findMethodInfo(String name, Signature sig)

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.findMethodInfo.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.findMethodInfo.

Find the method (if any) with the given name and Signature in this ClassInfo, or in any superType of this ClassInfo.

hashCodeback to summary
public synchronized int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
implsback to summary
public List<Type> impls()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.impls.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.impls.

Return the list of Types of interfaces implemented by this class. May be empty, but never null.

initializeClassback to summary
protected void initializeClass(Type thisType, Type superType, List<Type> impls)
initializeInterfaceback to summary
protected void initializeInterface(List<Type> exts)
isInterfaceback to summary
public boolean isInterface()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.isInterface.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.isInterface.

Return true iff this ClassInfo is an interface.

isSubclassback to summary
public boolean isSubclass(ClassInfo info)

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.isSubclass.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.isSubclass.

Return true iff this is a subclass or subinterface of info.

methodInfoByNameback to summary
public Map<String, Set<MethodInfo>> methodInfoByName()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.methodInfoByName.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.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.

modifiersback to summary
public int modifiers()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.modifiers.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.modifiers.

Return the modifiers on this class as specified in java.lang.reflect.Modifier.

nameback to summary
public String name()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.name.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.name.

Return the fully qualified class name for this ClassInfo.

pkgNameback to summary
public String pkgName()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.pkgName.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.pkgName.

Return the fully qualified package name containing the class represented by this ClassInfo.

superTypeback to summary
public Type superType()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.superType.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.superType.

Return the Type of the supertype of this class.

thisTypeback to summary
public Type thisType()

Implements org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.thisType.

Doc from org.glassfish.pfl.dynamic.codegen.spi.ClassInfo.thisType.

Return the Type of the class represented by this ClassInfo.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.