Top Description Inners Fields Constructors Methods
org.codehaus.janino

pack-priv Class ReflectionIClass

extends IClass
Class Inheritance
Imports
java.lang.annotation.Annotation, java.lang.reflect.Constructor, .Field, .GenericArrayType, .Method, .Modifier, .ParameterizedType, .Type, .TypeVariable, .WildcardType, java.util.Arrays, org.codehaus.commons.compiler.CompileException, .InternalCompilerException, .Location, org.codehaus.commons.nullanalysis.Nullable

Wraps a java.lang.Class in an org.codehaus.janino.IClass.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
public class

Field Summary

Modifier and TypeField and Description
private final Class<?>
private final IClassLoader
Inherited from org.codehaus.janino.IClass:
BOOLEANBYTECHARDOUBLEFLOATINTLONGNO_ANNOTATIONSNOT_CONSTANTNULLSHORTVOID

Constructor Summary

AccessConstructor and Description
pack-priv
ReflectionIClass(Class<?> clazz, IClassLoader
Required to load other IClasses on get...()
iClassLoader
)

Method Summary

Modifier and TypeMethod and Description
private IClass[]
private IClass
classToIClass(Class<?> c)

Loads Class through IClassLoader to ensure unique IClasses.

private IClass.IField[]
public Access
public Class<?>

Returns:

The underlying java.lang.Class
getClazz
()

protected IClass
protected IClass[]
protected IClass.IConstructor[]
getDeclaredIConstructors2()

Implements abstract org.codehaus.janino.IClass.getDeclaredIConstructors2.

The uncached version of getDeclaredIConstructors() which must be implemented by derived classes.
protected IClass.IField[]
protected IClass.IMethod[]
getDeclaredIMethods2()

Implements abstract org.codehaus.janino.IClass.getDeclaredIMethods2.

The uncached version of getDeclaredIMethods() which must be implemented by derived classes.
protected IClass
protected String
public IClass.IAnnotation[]
protected IClass[]
public ITypeVariable[]
getITypeVariables2()

Implements abstract org.codehaus.janino.IClass.getITypeVariables2.

The uncached version of getDeclaredIConstructors() which must be implemented by derived classes.
protected IClass
protected IClass
public boolean
isAbstract()

Implements abstract org.codehaus.janino.IClass.isAbstract.

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

Implements abstract org.codehaus.janino.IClass.isFinal.

Whether subclassing is allowed (JVMS 4.1 access_flags)
public boolean
public boolean
public boolean
private IClass.IMethod[]
private static Access
modifiers2Access(int modifiers)

public String

Returns:

E.g. "int", "int[][]", "pkg1.pkg2.Outer$Inner[]"
toString
()

Overrides org.codehaus.janino.IClass.toString.

Returns a string representation of the object.
private IType[]
private IType
private ITypeVariable
Inherited from org.codehaus.janino.IClass:
clearIFieldCachesfindIConstructorfindIMethodfindMemberTypegetComponentTypegetDeclaredIClassesgetDeclaredIConstructorsgetDeclaredIFieldgetDeclaredIFieldsgetDeclaredIMethodsgetDeclaredIMethodsgetDeclaringIClassgetDescriptorgetDescriptorsgetIAnnotationsgetIMethodsgetInterfacesgetITypeVariablesgetOuterIClassgetSuperclassgetSyntheticIFieldshasIMethodimplementsInterfaceinvalidateMethodCachesisAssignableFromisSubclassOfrawTypeOf

Field Detail

clazzback to summary
private final Class<?> clazz
iClassLoaderback to summary
private final IClassLoader iClassLoader

Constructor Detail

ReflectionIClassback to summary
pack-priv ReflectionIClass(Class<?> clazz, IClassLoader iClassLoader)
Parameters
iClassLoader:IClassLoader

Required to load other IClasses on get...()

Method Detail

classesToIClassesback to summary
private IClass[] classesToIClasses(Class<?>[] cs)
See Also
classToIClass(Class)
classToIClassback to summary
private IClass classToIClass(Class<?> c)

Loads Class through IClassLoader to ensure unique IClasses.

fieldsToIFieldsback to summary
private IClass.IField[] fieldsToIFields(Field[] fields)
getAccessback to summary
public Access getAccess()

Implements abstract org.codehaus.janino.IClass.getAccess.

Returns:Access

Doc from org.codehaus.janino.IClass.getAccess.

The accessibility of this type

Annotations
@Override
getClazzback to summary
public Class<?> getClazz()
Returns:Class<?>

The underlying java.lang.Class

getComponentType2back to summary
protected IClass getComponentType2()

Implements abstract org.codehaus.janino.IClass.getComponentType2.

Annotations
@Override
@Nullable
getDeclaredIClasses2back to summary
protected IClass[] getDeclaredIClasses2()

Implements abstract org.codehaus.janino.IClass.getDeclaredIClasses2.

Returns:IClass[]

Doc from org.codehaus.janino.IClass.getDeclaredIClasses2.

The member types of this type

Annotations
@Override
getDeclaredIConstructors2back to summary
protected IClass.IConstructor[] getDeclaredIConstructors2()

Implements abstract org.codehaus.janino.IClass.getDeclaredIConstructors2.

Doc from org.codehaus.janino.IClass.getDeclaredIConstructors2.

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

Annotations
@Override
getDeclaredIFields2back to summary
protected IClass.IField[] getDeclaredIFields2()

Implements abstract org.codehaus.janino.IClass.getDeclaredIFields2.

Doc from org.codehaus.janino.IClass.getDeclaredIFields2.

Uncached version of getDeclaredIFields().

Annotations
@Override
getDeclaredIMethods2back to summary
protected IClass.IMethod[] getDeclaredIMethods2()

Implements abstract org.codehaus.janino.IClass.getDeclaredIMethods2.

Doc from org.codehaus.janino.IClass.getDeclaredIMethods2.

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

Annotations
@Override
getDeclaringIClass2back to summary
protected IClass getDeclaringIClass2()

Implements abstract org.codehaus.janino.IClass.getDeclaringIClass2.

Returns:IClass

Doc from org.codehaus.janino.IClass.getDeclaringIClass2.

If this class is a member class, the declaring class, otherwise null

Annotations
@Override
@Nullable
getDescriptor2back to summary
protected String getDescriptor2()

Implements abstract org.codehaus.janino.IClass.getDescriptor2.

Returns:String

Doc from org.codehaus.janino.IClass.getDescriptor2.

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

Annotations
@Override
getIAnnotations2back to summary
public IClass.IAnnotation[] getIAnnotations2() throws CompileException

Overrides org.codehaus.janino.IClass.getIAnnotations2.

Annotations
@Override
getInterfaces2back to summary
protected IClass[] getInterfaces2()

Implements abstract org.codehaus.janino.IClass.getInterfaces2.

Annotations
@Override
getITypeVariables2back to summary
public ITypeVariable[] getITypeVariables2()

Implements abstract org.codehaus.janino.IClass.getITypeVariables2.

Doc from org.codehaus.janino.IClass.getITypeVariables2.

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

Annotations
@Override
getOuterIClass2back to summary
protected IClass getOuterIClass2() throws CompileException

Implements abstract org.codehaus.janino.IClass.getOuterIClass2.

Annotations
@Override
@Nullable
getSuperclass2back to summary
protected IClass getSuperclass2()

Implements abstract org.codehaus.janino.IClass.getSuperclass2.

Annotations
@Override
@Nullable
isAbstractback to summary
public boolean isAbstract()

Implements abstract org.codehaus.janino.IClass.isAbstract.

Doc from org.codehaus.janino.IClass.isAbstract.

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

Returns:boolean

true if instantiation is prohibited

Annotations
@Override
isArrayback to summary
public boolean isArray()

Implements abstract org.codehaus.janino.IClass.isArray.

Returns:boolean

Doc from org.codehaus.janino.IClass.isArray.

Whether this type represents an array

Annotations
@Override
isEnumback to summary
public boolean isEnum()

Implements abstract org.codehaus.janino.IClass.isEnum.

Returns:boolean

Doc from org.codehaus.janino.IClass.isEnum.

Whether this type represents an enum

Annotations
@Override
isFinalback to summary
public boolean isFinal()

Implements abstract org.codehaus.janino.IClass.isFinal.

Doc from org.codehaus.janino.IClass.isFinal.

Whether subclassing is allowed (JVMS 4.1 access_flags)

Returns:boolean

true if subclassing is prohibited

Annotations
@Override
isInterfaceback to summary
public boolean isInterface()

Implements abstract org.codehaus.janino.IClass.isInterface.

Returns:boolean

Doc from org.codehaus.janino.IClass.isInterface.

Whether this type represents an interface

Annotations
@Override
isPrimitiveback to summary
public boolean isPrimitive()

Implements abstract org.codehaus.janino.IClass.isPrimitive.

Returns:boolean

Doc from org.codehaus.janino.IClass.isPrimitive.

Whether this type represents a primitive type or void

Annotations
@Override
isPrimitiveNumericback to summary
public boolean isPrimitiveNumeric()

Implements abstract org.codehaus.janino.IClass.isPrimitiveNumeric.

Returns:boolean

Doc from org.codehaus.janino.IClass.isPrimitiveNumeric.

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

Annotations
@Override
methodsToIMethodsback to summary
private IClass.IMethod[] methodsToIMethods(Method[] methods)
modifiers2Accessback to summary
private static Access modifiers2Access(int modifiers)
toStringback to summary
public String toString()

Overrides org.codehaus.janino.IClass.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

E.g. "int", "int[][]", "pkg1.pkg2.Outer$Inner[]"

Annotations
@Override
typesToITypesback to summary
private IType[] typesToITypes(Type[] types) throws CompileException
typeToITypeback to summary
private IType typeToIType(Type type) throws CompileException
typeVariableToITypeVariableback to summary
private ITypeVariable typeVariableToITypeVariable(final TypeVariable<?> tv)
org.codehaus.janino back to summary

private Class ReflectionIClass.ReflectionIConstructor

extends IConstructor
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final Constructor<?>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Access
public IClass.IAnnotation[]
public MethodDescriptor
public IClass[]
getParameterTypes2()

Implements abstract org.codehaus.janino.IClass.IInvocable.getParameterTypes2.

Opposed to the Constructor, there is no magic "this$0" parameter.
public IClass[]
public boolean
Inherited from org.codehaus.janino.IClass.IConstructor:
toString

Field Detail

constructorback to summary
pack-priv final Constructor<?> constructor

Constructor Detail

ReflectionIConstructorback to summary
pack-priv ReflectionIConstructor(Constructor<?> constructor)

Method Detail

getAccessback to summary
public Access getAccess()

Implements org.codehaus.janino.IClass.IMember.getAccess.

Returns:Access

Doc from org.codehaus.janino.IClass.IMember.getAccess.

One of Access#PRIVATE, Access#PROTECTED, Access#DEFAULT and Access#PUBLIC.

Annotations
@Override
getAnnotationsback to summary
public IClass.IAnnotation[] getAnnotations()

Implements org.codehaus.janino.IClass.IMember.getAnnotations.

Returns:IClass.IAnnotation[]

Doc from org.codehaus.janino.IClass.IMember.getAnnotations.

Modifiers and/or annotations of this member

Annotations
@Override
getDescriptor2back to summary
public MethodDescriptor getDescriptor2()

Overrides org.codehaus.janino.IClass.IConstructor.getDescriptor2.

Doc from org.codehaus.janino.IClass.IInvocable.getDescriptor2.

Uncached implementation of getDescriptor().

Annotations
@Override
getParameterTypes2back to summary
public IClass[] getParameterTypes2() throws CompileException

Implements abstract org.codehaus.janino.IClass.IInvocable.getParameterTypes2.

Doc from org.codehaus.janino.IClass.IInvocable.getParameterTypes2.

Opposed to the Constructor, there is no magic "this$0" parameter.

Opposed to the Constructor, enums have no magic parameters "String name" and "int ordinal".

However, the "synthetic parameters" ("val$locvar") are included.

Annotations
@Override
getThrownExceptions2back to summary
public IClass[] getThrownExceptions2()

Implements abstract org.codehaus.janino.IClass.IInvocable.getThrownExceptions2.

Returns:IClass[]

Doc from org.codehaus.janino.IClass.IInvocable.getThrownExceptions2.

The types thrown by this constructor or method

Annotations
@Override
isVarargsback to summary
public boolean isVarargs()

Implements abstract org.codehaus.janino.IClass.IInvocable.isVarargs.

Returns:boolean

Doc from org.codehaus.janino.IClass.IInvocable.isVarargs.

Whether this invocable is 'variable arity', i.e. its last parameter has an ellipsis ('...') after the type

Annotations
@Override
org.codehaus.janino back to summary

private Class ReflectionIClass.ReflectionIField

extends IField
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final Field

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Access
public IClass.IAnnotation[]
public Object
getConstantValue()

Implements abstract org.codehaus.janino.IClass.IField.getConstantValue.

This implementation of IClass.IField#getConstantValue() is not completely correct:
  • It treats non-static fields as non-constant
  • Even fields with a non-constant initializer are identified as constant. (The value of that field may be different in a different JVM instance -- the classical example is java.io.File#separator.)
public String
public IClass
public boolean
public String
toString()

Overrides org.codehaus.janino.IClass.IField.toString.

Returns a string representation of the object.
Inherited from org.codehaus.janino.IClass.IField:
getDeclaringIClassgetDescriptor

Field Detail

fieldback to summary
pack-priv final Field field

Constructor Detail

ReflectionIFieldback to summary
pack-priv ReflectionIField(Field field)

Method Detail

getAccessback to summary
public Access getAccess()

Implements abstract org.codehaus.janino.IClass.IField.getAccess.

Implements org.codehaus.janino.IClass.IMember.getAccess.

Returns:Access

Doc from org.codehaus.janino.IClass.IMember.getAccess.

One of Access#PRIVATE, Access#PROTECTED, Access#DEFAULT and Access#PUBLIC.

Annotations
@Override
getAnnotationsback to summary
public IClass.IAnnotation[] getAnnotations()

Implements org.codehaus.janino.IClass.IMember.getAnnotations.

Returns:IClass.IAnnotation[]

Doc from org.codehaus.janino.IClass.IMember.getAnnotations.

Modifiers and/or annotations of this member

Annotations
@Override
getConstantValueback to summary
public Object getConstantValue() throws CompileException

Implements abstract org.codehaus.janino.IClass.IField.getConstantValue.

This implementation of IClass.IField#getConstantValue() is not completely correct:

  • It treats non-static fields as non-constant
  • Even fields with a non-constant initializer are identified as constant. (The value of that field may be different in a different JVM instance -- the classical example is java.io.File#separator.)

Notice that enum constants are not constant expression (despite the similarity of names).

Annotations
@Override
getNameback to summary
public String getName()

Implements abstract org.codehaus.janino.IClass.IField.getName.

Returns:String

Doc from org.codehaus.janino.IClass.IField.getName.

The name this field

Annotations
@Override
getTypeback to summary
public IClass getType()

Implements abstract org.codehaus.janino.IClass.IField.getType.

Returns:IClass

Doc from org.codehaus.janino.IClass.IField.getType.

The type of this field

Annotations
@Override
isStaticback to summary
public boolean isStatic()

Implements abstract org.codehaus.janino.IClass.IField.isStatic.

Returns:boolean

Doc from org.codehaus.janino.IClass.IField.isStatic.

Whether this field is STATIC

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.codehaus.janino.IClass.IField.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.codehaus.janino back to summary

public Class ReflectionIClass.ReflectionIMethod

extends IMethod
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Method

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Access
public IClass.IAnnotation[]
public String
public IClass[]
getParameterTypes2()

Implements abstract org.codehaus.janino.IClass.IInvocable.getParameterTypes2.

Opposed to the Constructor, there is no magic "this$0" parameter.
public IClass
public IClass[]
public boolean
public boolean
public boolean
Inherited from org.codehaus.janino.IClass.IMethod:
getDescriptor2isLessSpecificThanisMoreSpecificThantoString

Field Detail

methodback to summary
private final Method method

Constructor Detail

ReflectionIMethodback to summary
pack-priv ReflectionIMethod(Method method)

Method Detail

getAccessback to summary
public Access getAccess()

Implements org.codehaus.janino.IClass.IMember.getAccess.

Returns:Access

Doc from org.codehaus.janino.IClass.IMember.getAccess.

One of Access#PRIVATE, Access#PROTECTED, Access#DEFAULT and Access#PUBLIC.

Annotations
@Override
getAnnotationsback to summary
public IClass.IAnnotation[] getAnnotations()

Implements org.codehaus.janino.IClass.IMember.getAnnotations.

Returns:IClass.IAnnotation[]

Doc from org.codehaus.janino.IClass.IMember.getAnnotations.

Modifiers and/or annotations of this member

Annotations
@Override
getNameback to summary
public String getName()

Implements abstract org.codehaus.janino.IClass.IMethod.getName.

Returns:String

Doc from org.codehaus.janino.IClass.IMethod.getName.

The name of this method

Annotations
@Override
getParameterTypes2back to summary
public IClass[] getParameterTypes2()

Implements abstract org.codehaus.janino.IClass.IInvocable.getParameterTypes2.

Doc from org.codehaus.janino.IClass.IInvocable.getParameterTypes2.

Opposed to the Constructor, there is no magic "this$0" parameter.

Opposed to the Constructor, enums have no magic parameters "String name" and "int ordinal".

However, the "synthetic parameters" ("val$locvar") are included.

Annotations
@Override
getReturnTypeback to summary
public IClass getReturnType()

Implements abstract org.codehaus.janino.IClass.IMethod.getReturnType.

Returns:IClass

Doc from org.codehaus.janino.IClass.IMethod.getReturnType.

The return type of this method

Annotations
@Override
getThrownExceptions2back to summary
public IClass[] getThrownExceptions2()

Implements abstract org.codehaus.janino.IClass.IInvocable.getThrownExceptions2.

Returns:IClass[]

Doc from org.codehaus.janino.IClass.IInvocable.getThrownExceptions2.

The types thrown by this constructor or method

Annotations
@Override
isAbstractback to summary
public boolean isAbstract()

Implements abstract org.codehaus.janino.IClass.IMethod.isAbstract.

Returns:boolean

Doc from org.codehaus.janino.IClass.IMethod.isAbstract.

Whether this method is ABSTRACT

Annotations
@Override
isStaticback to summary
public boolean isStatic()

Implements abstract org.codehaus.janino.IClass.IMethod.isStatic.

Returns:boolean

Doc from org.codehaus.janino.IClass.IMethod.isStatic.

Whether this method is STATIC

Annotations
@Override
isVarargsback to summary
public boolean isVarargs()

Implements abstract org.codehaus.janino.IClass.IInvocable.isVarargs.

Returns:boolean

Doc from org.codehaus.janino.IClass.IInvocable.isVarargs.

Whether this invocable is 'variable arity', i.e. its last parameter has an ellipsis ('...') after the type

Annotations
@Override