public abstract class IClass extends Object
'JLS7' means a reference to the Java Language Specification, Java SE 7 Edition.
| Modifier and Type | Class and Description |
|---|---|
static interface |
IClass.IAnnotation
Representation of a Java "annotation".
|
class |
IClass.IConstructor
Representation of a constructor of an
IClass. |
class |
IClass.IField
Representation of a field of this
IClass. |
class |
IClass.IInvocable
Base class for
IClass.IConstructor and IClass.IMethod. |
static interface |
IClass.IMember
Base for the members of an
IClass. |
class |
IClass.IMethod
Representation of a method in an
IClass. |
| Modifier and Type | Field and Description |
|---|---|
static IClass |
BOOLEAN
The
IClass object for the primitive type BOOLEAN. |
static IClass |
BYTE
The
IClass object for the primitive type BYTE. |
static IClass |
CHAR
The
IClass object for the primitive type CHAR. |
static IClass |
DOUBLE
The
IClass object for the primitive type DOUBLE. |
static IClass |
FLOAT
The
IClass object for the primitive type FLOAT. |
static IClass |
INT
The
IClass object for the primitive type INT. |
static IClass |
LONG
The
IClass object for the primitive type LONG. |
static IClass.IAnnotation[] |
NO_ANNOTATIONS
Array of zero
IClass.IAnnotations. |
static Object |
NOT_CONSTANT
Special return value for
IClass.IField.getConstantValue() indicating that the field does not have a
constant value. |
static IClass |
SHORT
The
IClass object for the primitive type SHORT. |
static IClass |
VOID
The
IClass object for the type VOID. |
| Constructor and Description |
|---|
IClass() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearIFieldCaches()
Clears the cache of declared fields which this class maintains in order to minimize the invocations of
getDeclaredIFields2(). |
IClass.IConstructor |
findIConstructor(IClass[] parameterTypes) |
IClass.IMethod |
findIMethod(String methodName,
IClass[] parameterTypes) |
abstract Access |
getAccess() |
IClass |
getArrayIClass(IClass objectType)
Gets an
IClass that represents an array of this type. |
IClass |
getArrayIClass(int n,
IClass objectType)
Gets an
IClass that represents an n-dimensional array of this type. |
IClass |
getComponentType() |
protected abstract IClass |
getComponentType2() |
IClass[] |
getDeclaredIClasses()
Returns the classes and interfaces declared as members of the class (but not inherited classes and interfaces).
|
protected abstract IClass[] |
getDeclaredIClasses2() |
IClass.IConstructor[] |
getDeclaredIConstructors()
Returns all the constructors declared by the class represented by the type.
|
protected abstract IClass.IConstructor[] |
getDeclaredIConstructors2()
The uncached version of
getDeclaredIConstructors() which must be implemented by derived classes. |
IClass.IField |
getDeclaredIField(String name)
Returns the named
IClass.IField declared in this IClass (does not work for inherited fields). |
IClass.IField[] |
getDeclaredIFields()
Returns the
IClass.IFields declared in this IClass (but not inherited fields). |
protected abstract IClass.IField[] |
getDeclaredIFields2()
Uncached version of
getDeclaredIFields(). |
IClass.IMethod[] |
getDeclaredIMethods()
Returns the methods of the class or interface (but not inherited methods).
|
IClass.IMethod[] |
getDeclaredIMethods(String methodName)
Returns all methods with the given name declared in the class or interface (but not inherited methods).
|
protected abstract IClass.IMethod[] |
getDeclaredIMethods2()
The uncached version of
getDeclaredIMethods() which must be implemented by derived classes. |
IClass |
getDeclaringIClass() |
protected abstract IClass |
getDeclaringIClass2() |
String |
getDescriptor()
Returns the field descriptor for the type as defined by JVMS 4.3.2.
|
protected abstract String |
getDescriptor2() |
static String[] |
getDescriptors(IClass[] iClasses)
Convenience method that determines the field descriptors of an array of
IClasses. |
IClass.IAnnotation[] |
getIAnnotations() |
protected IClass.IAnnotation[] |
getIAnnotations2() |
IClass.IMethod[] |
getIMethods()
Returns all methods declared in the class or interface, its superclasses and its superinterfaces.
|
IClass[] |
getInterfaces()
Returns the interfaces implemented by the class, respectively the superinterfaces of the interface, respectively
{ Cloneable, Serializable } for arrays. |
protected abstract IClass[] |
getInterfaces2() |
IClass |
getOuterIClass()
The following types have an "outer class":
Anonymous classes declared in a non-static method of a class
Local classes declared in a non-static method of a class
Non-static member classes
|
protected abstract IClass |
getOuterIClass2() |
IClass |
getSuperclass()
Returns the superclass of the class.
|
protected abstract IClass |
getSuperclass2() |
IClass.IField[] |
getSyntheticIFields() |
boolean |
hasIMethod(String methodName,
IClass[] parameterTypes) |
boolean |
implementsInterface(IClass that)
If
this represents a class: Return true if this class directly or indirectly implements that interface. |
void |
invalidateMethodCaches()
This class caches the declared methods in order to minimize the invocations of
getDeclaredIMethods2(). |
abstract boolean |
isAbstract()
Whether the class may be instantiated (JVMS 4.1 access_flags).
|
abstract boolean |
isArray() |
boolean |
isAssignableFrom(IClass that)
Determines if
this is assignable from that. |
abstract boolean |
isEnum() |
abstract boolean |
isFinal()
Whether subclassing is allowed (JVMS 4.1 access_flags)
|
abstract boolean |
isInterface() |
abstract boolean |
isPrimitive() |
abstract boolean |
isPrimitiveNumeric() |
boolean |
isSubclassOf(IClass that)
Returns
true if this class is an immediate or non-immediate subclass of that class. |
String |
toString() |
public static final Object NOT_CONSTANT
IClass.IField.getConstantValue() indicating that the field does not have a
constant value.public static final IClass.IAnnotation[] NO_ANNOTATIONS
IClass.IAnnotations.public final IClass.IConstructor[] getDeclaredIConstructors()
Returns an array with zero elements for an interface, array, primitive type or void.
protected abstract IClass.IConstructor[] getDeclaredIConstructors2()
getDeclaredIConstructors() which must be implemented by derived classes.public final IClass.IMethod[] getDeclaredIMethods()
Returns an empty array for an array, primitive type or void.
protected abstract IClass.IMethod[] getDeclaredIMethods2()
getDeclaredIMethods() which must be implemented by derived classes.public final IClass.IMethod[] getDeclaredIMethods(String methodName)
Returns an empty array if no methods with that name are declared.
IClass.IMethods that must not be modifiedpublic final IClass.IMethod[] getIMethods() throws CompileException
IClass.IMethods that must not be modifiedCompileExceptionpublic final boolean hasIMethod(String methodName, IClass[] parameterTypes) throws CompileException
IClass (or its superclass or the interfaces it implements) has an IClass.IMethod
with the given name and parameter typesCompileException@Nullable public final IClass.IMethod findIMethod(String methodName, IClass[] parameterTypes) throws CompileException
IClass.IMethod declared in this IClass (or its superclass or the interfaces it implements)
with the given name and parameter types, or null if an applicable method could not be foundCompileException@Nullable public final IClass.IConstructor findIConstructor(IClass[] parameterTypes) throws CompileException
IClass.IConstructor declared in this IClass with the given parameter types, or null
if an applicable constructor could not be foundCompileExceptionpublic final IClass.IField[] getDeclaredIFields()
IClass.IFields declared in this IClass (but not inherited fields).void@Nullable public final IClass.IField getDeclaredIField(String name)
IClass.IField declared in this IClass (does not work for inherited fields).null iff this IClass does not declare an IClass.IField with that nameprotected void clearIFieldCaches()
getDeclaredIFields2().protected abstract IClass.IField[] getDeclaredIFields2()
getDeclaredIFields().public IClass.IField[] getSyntheticIFields()
public final IClass[] getDeclaredIClasses() throws CompileException
Returns an empty array for an array, primitive type or void.
CompileExceptionprotected abstract IClass[] getDeclaredIClasses2() throws CompileException
CompileException@Nullable public final IClass getDeclaringIClass() throws CompileException
nullCompileException@Nullable protected abstract IClass getDeclaringIClass2() throws CompileException
nullCompileException@Nullable public final IClass getOuterIClass() throws CompileException
nullCompileException@Nullable protected abstract IClass getOuterIClass2() throws CompileException
CompileExceptiongetOuterIClass()@Nullable public final IClass getSuperclass() throws CompileException
Returns null for class Object, interfaces, arrays, primitive types and void.
CompileException@Nullable protected abstract IClass getSuperclass2() throws CompileException
CompileExceptiongetSuperclass()public abstract Access getAccess()
public abstract boolean isFinal()
true if subclassing is prohibitedpublic final IClass[] getInterfaces() throws CompileException
{ Cloneable, Serializable } for arrays.
Returns an empty array for primitive types and void.
CompileExceptionprotected abstract IClass[] getInterfaces2() throws CompileException
CompileExceptiongetInterfaces()public abstract boolean isAbstract()
true if instantiation is prohibitedpublic final String getDescriptor()
protected abstract String getDescriptor2()
public static String[] getDescriptors(IClass[] iClasses)
IClasses.getDescriptor()public abstract boolean isEnum()
public abstract boolean isInterface()
public abstract boolean isArray()
public abstract boolean isPrimitive()
voidpublic abstract boolean isPrimitiveNumeric()
byte, short, int, long, char,
float or double@Nullable public final IClass getComponentType()
null for classes, interfaces, primitive types and void@Nullable protected abstract IClass getComponentType2()
getComponentType()public boolean isAssignableFrom(IClass that) throws CompileException
this is assignable from that. This is true if this is identical with
that (JLS7 5.1.1), or if that is widening-primitive-convertible to this (JLS7
5.1.2), or if that is widening-reference-convertible to this (JLS7 5.1.5).CompileExceptionpublic boolean isSubclassOf(IClass that) throws CompileException
true if this class is an immediate or non-immediate subclass of that class.CompileExceptionpublic boolean implementsInterface(IClass that) throws CompileException
this represents a class: Return true if this class directly or indirectly implements that interface.
If this represents an interface: Return true if this interface directly or indirectly extends
that interface.
CompileExceptionpublic IClass getArrayIClass(int n, IClass objectType)
IClass that represents an n-dimensional array of this type.n - dimension countobjectType - Required because the superclass of an array class is Object by definitionpublic IClass getArrayIClass(IClass objectType)
IClass that represents an array of this type.objectType - Required because the superclass of an array class is Object by definitionpublic final IClass.IAnnotation[] getIAnnotations() throws CompileException
CompileExceptionprotected IClass.IAnnotation[] getIAnnotations2() throws CompileException
CompileExceptionpublic void invalidateMethodCaches()
getDeclaredIMethods2().Copyright © 2019. All rights reserved.