Top Description Inners Fields Constructors Methods
org.codehaus.janino

public abstract Class IClass

extends Object
implements ITypeVariableOrIClass
Class Inheritance
All Implemented Interfaces
org.codehaus.janino.ITypeVariableOrIClass, org.codehaus.janino.IType
Known Direct Subclasses
org.codehaus.janino.IClass.PrimitiveIClass, org.codehaus.janino.ReflectionIClass, org.codehaus.janino.ClassFileIClass
Imports
java.io.Serializable, java.lang.reflect.Constructor, java.util.ArrayList, .Arrays, .Collection, .HashMap, .HashSet, .LinkedHashMap, .List, .Map, .Set, java.util.logging.Logger, org.codehaus.commons.compiler.CompileException, org.codehaus.commons.nullanalysis.Nullable

A simplified equivalent to "java.lang.reflect".

'JLS7' means a reference to the Java Language Specification, Java SE 7 Edition.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
IClass.IAnnotation

Representation of a Java "annotation".

public abstract class
IClass.IConstructor

Representation of a constructor of an IClass.

public abstract class
IClass.IField

Representation of a field of this IClass.

public abstract class
public static interface
IClass.IMember

Base for the members of an IClass.

public abstract class
IClass.IMethod

Representation of a method in an IClass.

private static class

Field Summary

Modifier and TypeField and Description
public static final IClass
BOOLEAN

The IClass object for the primitive type BOOLEAN.

public static final IClass
BYTE

The IClass object for the primitive type BYTE.

public static final IClass
CHAR

The IClass object for the primitive type CHAR.

private IClass
private boolean
private IClass[]
private IClass.IConstructor[]
private Map<String, IClass.IField>
private Map<String, Object>
private IClass.IMethod[]
private IClass
private boolean
private String
public static final IClass
DOUBLE

The IClass object for the primitive type DOUBLE.

public static final IClass
FLOAT

The IClass object for the primitive type FLOAT.

private IClass.IAnnotation[]
private IClass.IMethod[]
public static final IClass
INT

The IClass object for the primitive type INT.

private IClass[]
private ITypeVariable[]
private static final Logger
public static final IClass
LONG

The IClass object for the primitive type LONG.

private final Map<String, IClass[]>
public static final IClass.IAnnotation[]
NO_ANNOTATIONS

Array of zero IAnnotations.

private static final IClass.IMethod[]
public static final Object
NOT_CONSTANT

Special return value for IField#getConstantValue() indicating that the field does not have a constant value.

public static final IClass
NULL

The IClass of the null literal.

private IClass
private boolean
private static final Set<String>
public static final IClass
SHORT

The IClass object for the primitive type SHORT.

private IClass
private boolean
public static final IClass
VOID

The IClass object for the type VOID.

private static final IClass[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
clearIFieldCaches()

Clears the cache of declared fields which this class maintains in order to minimize the invocations of getDeclaredIFields2().

public final IClass.IConstructor

Returns:

The IConstructor declared in this IClass with the given parameter types, or null if an applicable constructor could not be found
findIConstructor
(IClass[] parameterTypes)

public final IClass.IMethod

Returns:

The 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 found
findIMethod
(String methodName, IClass[] parameterTypes)

pack-priv IClass[]

Returns:

an array of IClasses in unspecified order, possibly of length zero
findMemberType
(String name)

If name is null, finds all IClasses visible in the scope of the current class.

private void
public abstract Access

Returns:

The accessibility of this type
getAccess
()

public final IClass

Returns:

The component type of the array, or null for classes, interfaces, primitive types and void
getComponentType
()

protected abstract IClass
public final IClass[]
getDeclaredIClasses()

Returns the classes and interfaces declared as members of the class (but not inherited classes and interfaces).

protected abstract IClass[]

Returns:

The member types of this type
getDeclaredIClasses2
()

public final 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.

public final IClass.IField

Returns:

null iff this IClass does not declare an IField with that name
getDeclaredIField
(String name)

Returns the named IField declared in this IClass (does not work for inherited fields).

public final IClass.IField[]

Returns:

An empty array for an array, primitive type or void
getDeclaredIFields
()

Returns the IFields declared in this IClass (but not inherited fields).

protected abstract IClass.IField[]
private Map<String, IClass.IField>

Returns:

String fieldName => IField
getDeclaredIFieldsCache
()

public final IClass.IMethod[]
getDeclaredIMethods()

Returns the methods of the class or interface (but not inherited methods).

public final IClass.IMethod[]

Returns:

an array of IMethods that must not be modified
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.

public final IClass

Returns:

If this class is a member class, the declaring class, otherwise null
getDeclaringIClass
()

protected abstract IClass

Returns:

If this class is a member class, the declaring class, otherwise null
getDeclaringIClass2
()

public final String
getDescriptor()

Returns the field descriptor for the type as defined by JVMS 4.3.2.

protected abstract String

Returns:

The field descriptor for the type as defined by JVMS 4.3.2.
getDescriptor2
()

public static String[]
getDescriptors(IClass[] iClasses)

Convenience method that determines the field descriptors of an array of IClasses.

public final IClass.IAnnotation[]

Returns:

The annotations of this type (possibly the empty array)
getIAnnotations
()

protected IClass.IAnnotation[]
public final IClass.IMethod[]

Returns:

an array of IMethods that must not be modified
getIMethods
()

Returns all methods declared in the class or interface, its superclasses and its superinterfaces.

private void
public final IClass[]
getInterfaces()

Returns the interfaces implemented by the class, respectively the superinterfaces of the interface, respectively { Cloneable, Serializable } for arrays.

protected abstract IClass[]
public final ITypeVariable[]

Returns:

Zero-length array if this IClass declares no type variables
getITypeVariables
()

protected abstract ITypeVariable[]
getITypeVariables2()

The uncached version of getDeclaredIConstructors() which must be implemented by derived classes.

public final IClass

Returns:

The outer class of this type, or null
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
public final IClass
getSuperclass()

Returns the superclass of the class.

protected abstract IClass
public IClass.IField[]

Returns:

The synthetic fields of an anonymous or local class, in the order in which they are passed to all constructors
getSyntheticIFields
()

public final boolean

Returns:

Whether this IClass (or its superclass or the interfaces it implements) has an IMethod with the given name and parameter types
hasIMethod
(String methodName, IClass[] parameterTypes)

public boolean
implementsInterface(IClass that)

If this represents a class: Return true if this class directly or indirectly implements that interface.

public void
invalidateMethodCaches()

This class caches the declared methods in order to minimize the invocations of getDeclaredIMethods2().

public abstract boolean

Returns:

true if instantiation is prohibited
isAbstract
()

Whether the class may be instantiated (JVMS 4.1 access_flags).

public abstract boolean

Returns:

Whether this type represents an array
isArray
()

public boolean
isAssignableFrom(IClass that)

Determines if this is assignable from that.

public abstract boolean

Returns:

Whether this type represents an enum
isEnum
()

public abstract boolean

Returns:

true if subclassing is prohibited
isFinal
()

Whether subclassing is allowed (JVMS 4.1 access_flags)

public abstract boolean

Returns:

Whether this type represents an interface
isInterface
()

public abstract boolean

Returns:

Whether this type represents a primitive type or void
isPrimitive
()

public abstract boolean

Returns:

Whether this type represents byte, short, int, long, char, float or double
isPrimitiveNumeric
()

public boolean
isSubclassOf(IClass that)

Returns true if this class is an immediate or non-immediate subclass of that class.

public static IClass
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait