Package org.codehaus.janino
Class ReflectionIClass
- java.lang.Object
-
- org.codehaus.janino.IClass
-
- org.codehaus.janino.ReflectionIClass
-
- All Implemented Interfaces:
IType,ITypeVariableOrIClass
class ReflectionIClass extends IClass
Wraps aClassin anIClass.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classReflectionIClass.ReflectionIConstructorprivate classReflectionIClass.ReflectionIFieldclassReflectionIClass.ReflectionIMethod-
Nested classes/interfaces inherited from class org.codehaus.janino.IClass
IClass.IAnnotation, IClass.IConstructor, IClass.IField, IClass.IInvocable, IClass.IMember, IClass.IMethod
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<?>clazzprivate IClassLoaderiClassLoader
-
Constructor Summary
Constructors Constructor Description ReflectionIClass(java.lang.Class<?> clazz, IClassLoader iClassLoader)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private IClass[]classesToIClasses(java.lang.Class<?>[] cs)private IClassclassToIClass(java.lang.Class<?> c)private IClass.IField[]fieldsToIFields(java.lang.reflect.Field[] fields)AccessgetAccess()java.lang.Class<?>getClazz()protected IClassgetComponentType2()protected IClass[]getDeclaredIClasses2()protected IClass.IConstructor[]getDeclaredIConstructors2()The uncached version ofIClass.getDeclaredIConstructors()which must be implemented by derived classes.protected IClass.IField[]getDeclaredIFields2()Uncached version ofIClass.getDeclaredIFields().protected IClass.IMethod[]getDeclaredIMethods2()The uncached version ofIClass.getDeclaredIMethods()which must be implemented by derived classes.protected IClassgetDeclaringIClass2()protected java.lang.StringgetDescriptor2()IClass.IAnnotation[]getIAnnotations2()protected IClass[]getInterfaces2()ITypeVariable[]getITypeVariables2()The uncached version ofIClass.getDeclaredIConstructors()which must be implemented by derived classes.protected IClassgetOuterIClass2()protected IClassgetSuperclass2()booleanisAbstract()Whether the class may be instantiated (JVMS 4.1 access_flags).booleanisArray()booleanisEnum()booleanisFinal()Whether subclassing is allowed (JVMS 4.1 access_flags)booleanisInterface()booleanisPrimitive()booleanisPrimitiveNumeric()private IClass.IMethod[]methodsToIMethods(java.lang.reflect.Method[] methods)private static Accessmodifiers2Access(int modifiers)java.lang.StringtoString()private IType[]typesToITypes(java.lang.reflect.Type[] types)private ITypetypeToIType(java.lang.reflect.Type type)private ITypeVariabletypeVariableToITypeVariable(java.lang.reflect.TypeVariable<?> tv)-
Methods inherited from class org.codehaus.janino.IClass
clearIFieldCaches, findIConstructor, findIMethod, findMemberType, getComponentType, getDeclaredIClasses, getDeclaredIConstructors, getDeclaredIField, getDeclaredIFields, getDeclaredIMethods, getDeclaredIMethods, getDeclaringIClass, getDescriptor, getDescriptors, getIAnnotations, getIMethods, getInterfaces, getITypeVariables, getOuterIClass, getSuperclass, getSyntheticIFields, hasIMethod, implementsInterface, invalidateMethodCaches, isAssignableFrom, isSubclassOf, rawTypeOf
-
-
-
-
Field Detail
-
clazz
private final java.lang.Class<?> clazz
-
iClassLoader
private final IClassLoader iClassLoader
-
-
Constructor Detail
-
ReflectionIClass
ReflectionIClass(java.lang.Class<?> clazz, IClassLoader iClassLoader)- Parameters:
iClassLoader- Required to load otherIClasses onget...()
-
-
Method Detail
-
getITypeVariables2
public ITypeVariable[] getITypeVariables2()
Description copied from class:IClassThe uncached version ofIClass.getDeclaredIConstructors()which must be implemented by derived classes.- Specified by:
getITypeVariables2in classIClass
-
typeVariableToITypeVariable
private ITypeVariable typeVariableToITypeVariable(java.lang.reflect.TypeVariable<?> tv)
-
typesToITypes
private IType[] typesToITypes(java.lang.reflect.Type[] types) throws CompileException
- Throws:
CompileException
-
typeToIType
private IType typeToIType(java.lang.reflect.Type type) throws CompileException
- Throws:
CompileException
-
getDeclaredIConstructors2
protected IClass.IConstructor[] getDeclaredIConstructors2()
Description copied from class:IClassThe uncached version ofIClass.getDeclaredIConstructors()which must be implemented by derived classes.- Specified by:
getDeclaredIConstructors2in classIClass
-
getDeclaredIMethods2
protected IClass.IMethod[] getDeclaredIMethods2()
Description copied from class:IClassThe uncached version ofIClass.getDeclaredIMethods()which must be implemented by derived classes.- Specified by:
getDeclaredIMethods2in classIClass
-
getDeclaredIFields2
protected IClass.IField[] getDeclaredIFields2()
Description copied from class:IClassUncached version ofIClass.getDeclaredIFields().- Specified by:
getDeclaredIFields2in classIClass
-
getDeclaredIClasses2
protected IClass[] getDeclaredIClasses2()
- Specified by:
getDeclaredIClasses2in classIClass- Returns:
- The member types of this type
-
getDeclaringIClass2
@Nullable protected IClass getDeclaringIClass2()
- Specified by:
getDeclaringIClass2in classIClass- Returns:
- If this class is a member class, the declaring class, otherwise
null
-
getOuterIClass2
@Nullable protected IClass getOuterIClass2() throws CompileException
- Specified by:
getOuterIClass2in classIClass- Throws:
CompileException- See Also:
IClass.getOuterIClass()
-
getSuperclass2
@Nullable protected IClass getSuperclass2()
- Specified by:
getSuperclass2in classIClass- See Also:
IClass.getSuperclass()
-
getComponentType2
@Nullable protected IClass getComponentType2()
- Specified by:
getComponentType2in classIClass- See Also:
IClass.getComponentType()
-
getInterfaces2
protected IClass[] getInterfaces2()
- Specified by:
getInterfaces2in classIClass- See Also:
IClass.getInterfaces()
-
getDescriptor2
protected java.lang.String getDescriptor2()
- Specified by:
getDescriptor2in classIClass- Returns:
- The field descriptor for the type as defined by JVMS 4.3.2.
-
getAccess
public Access getAccess()
-
isFinal
public boolean isFinal()
Description copied from class:IClassWhether subclassing is allowed (JVMS 4.1 access_flags)
-
isEnum
public boolean isEnum()
-
isInterface
public boolean isInterface()
- Specified by:
isInterfacein classIClass- Returns:
- Whether this type represents an interface
-
isAbstract
public boolean isAbstract()
Description copied from class:IClassWhether the class may be instantiated (JVMS 4.1 access_flags).- Specified by:
isAbstractin classIClass- Returns:
trueif instantiation is prohibited
-
isArray
public boolean isArray()
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitivein classIClass- Returns:
- Whether this type represents a primitive type or
void
-
isPrimitiveNumeric
public boolean isPrimitiveNumeric()
- Specified by:
isPrimitiveNumericin classIClass- Returns:
- Whether this type represents
byte,short,int,long,char,floatordouble
-
getIAnnotations2
public IClass.IAnnotation[] getIAnnotations2() throws CompileException
- Overrides:
getIAnnotations2in classIClass- Throws:
CompileException
-
getClazz
public java.lang.Class<?> getClazz()
- Returns:
- The underlying
java.lang.Class
-
toString
public java.lang.String toString()
-
classToIClass
private IClass classToIClass(java.lang.Class<?> c)
-
classesToIClasses
private IClass[] classesToIClasses(java.lang.Class<?>[] cs)
- See Also:
classToIClass(Class)
-
methodsToIMethods
private IClass.IMethod[] methodsToIMethods(java.lang.reflect.Method[] methods)
-
fieldsToIFields
private IClass.IField[] fieldsToIFields(java.lang.reflect.Field[] fields)
-
modifiers2Access
private static Access modifiers2Access(int modifiers)
-
-