Class ClassFileIClass
java.lang.Object
org.codehaus.janino.IClass
org.codehaus.janino.ClassFileIClass
- All Implemented Interfaces:
IType, ITypeVariableOrIClass
-
Nested Class Summary
Nested classes/interfaces inherited from class IClass
IClass.IAnnotation, IClass.IConstructor, IClass.IField, IClass.IInvocable, IClass.IMember, IClass.IMethod -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final shortprivate final ClassFileprivate final SignatureParser.ClassSignatureprivate final IClassLoaderprivate static final Loggerprivate final Map<ClassFile.FieldInfo, IClass.IField> private final Map<ClassFile.MethodInfo, IClass.IInvocable> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static AccessaccessFlags2Access(short accessFlags) private ITypeVariableOrIClassprivate ITypeVariableOrIClass[]protected IClassprotected IClass[]protected IClass.IConstructor[]The uncached version ofIClass.getDeclaredIConstructors()which must be implemented by derived classes.protected IClass.IField[]Uncached version ofIClass.getDeclaredIFields().protected IClass.IMethod[]The uncached version ofIClass.getDeclaredIMethods()which must be implemented by derived classes.protected IClassprotected Stringprotected IClass.IAnnotation[]protected IClass[]protected ITypeVariable[]The uncached version ofIClass.getDeclaredIConstructors()which must be implemented by derived classes.protected IClassprotected IClassbooleanWhether the class may be instantiated (JVMS 4.1 access_flags).booleanisArray()booleanisEnum()booleanisFinal()Whether subclassing is allowed (JVMS 4.1 access_flags)booleanbooleanbooleanvoidResolves all classes referenced by this class file.private IClassresolveClass(short index) private IClassresolveClass(String descriptor) private IClass[]resolveClasses(short[] ifs) private IClass.IFieldresolveField(ClassFile.FieldInfo fieldInfo) private IClass.IInvocableresolveMethod(ClassFile.MethodInfo methodInfo) Turns aClassFile.MethodInfointo anIClass.IInvocable.private IClass.IAnnotationtoIAnnotation(ClassFile.Annotation annotation) private IClass.IAnnotation[]toIAnnotations(ClassFile.Annotation[] annotations) Methods inherited from class 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, toString
-
Field Details
-
LOGGER
-
classFile
-
iClassLoader
-
accessFlags
private final short accessFlags -
classSignature
-
resolvedFields
-
resolvedClasses
-
resolvedMethods
-
-
Constructor Details
-
ClassFileIClass
- Parameters:
classFile- Source of dataiClassLoader-IClassLoaderthrough which to load other classes
-
-
Method Details
-
getITypeVariables2
Description copied from class:IClassThe uncached version ofIClass.getDeclaredIConstructors()which must be implemented by derived classes.- Specified by:
getITypeVariables2in classIClass- Throws:
CompileException
-
getBounds
private ITypeVariableOrIClass[] getBounds(SignatureParser.FormalTypeParameter ftp) throws CompileException - Throws:
CompileException
-
fieldTypeSignatureToITypeVariableOrIClass
private ITypeVariableOrIClass fieldTypeSignatureToITypeVariableOrIClass(SignatureParser.FieldTypeSignature fts) throws CompileException - Throws:
CompileException
-
getDeclaredIConstructors2
Description copied from class:IClassThe uncached version ofIClass.getDeclaredIConstructors()which must be implemented by derived classes.- Specified by:
getDeclaredIConstructors2in classIClass
-
getDeclaredIMethods2
Description copied from class:IClassThe uncached version ofIClass.getDeclaredIMethods()which must be implemented by derived classes.- Specified by:
getDeclaredIMethods2in classIClass
-
getDeclaredIFields2
Description copied from class:IClassUncached version ofIClass.getDeclaredIFields().- Specified by:
getDeclaredIFields2in classIClass
-
getDeclaredIClasses2
- Specified by:
getDeclaredIClasses2in classIClass- Returns:
- The member types of this type
- Throws:
CompileException
-
getDeclaringIClass2
- Specified by:
getDeclaringIClass2in classIClass- Returns:
- If this class is a member class, the declaring class, otherwise
null - Throws:
CompileException
-
getOuterIClass2
- Specified by:
getOuterIClass2in classIClass- Throws:
CompileException- See Also:
-
getSuperclass2
- Specified by:
getSuperclass2in classIClass- Throws:
CompileException- See Also:
-
getAccess
-
isFinal
-
getInterfaces2
- Specified by:
getInterfaces2in classIClass- Throws:
CompileException- See Also:
-
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
-
getDescriptor2
- Specified by:
getDescriptor2in classIClass- Returns:
- The field descriptor for the type as defined by JVMS 4.3.2.
-
isEnum
-
isInterface
public boolean isInterface()- Specified by:
isInterfacein classIClass- Returns:
- Whether this type represents an interface
-
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
-
getComponentType2
- Specified by:
getComponentType2in classIClass- See Also:
-
getIAnnotations2
- Overrides:
getIAnnotations2in classIClass- Throws:
CompileException
-
toIAnnotations
private IClass.IAnnotation[] toIAnnotations(ClassFile.Annotation[] annotations) throws CompileException - Throws:
CompileException
-
toIAnnotation
- Throws:
CompileException
-
resolveAllClasses
Resolves all classes referenced by this class file.- Throws:
ClassNotFoundException
-
resolveClass
- Parameters:
index- Index of the CONSTANT_Class_info to resolve (JVMS 4.4.1)- Throws:
ClassNotFoundException
-
resolveClass
- Throws:
ClassNotFoundException
-
resolveClasses
- Throws:
CompileException
-
resolveMethod
private IClass.IInvocable resolveMethod(ClassFile.MethodInfo methodInfo) throws ClassNotFoundException Turns aClassFile.MethodInfointo anIClass.IInvocable. This includes the checking and the removal of the magic first parameter of an inner class constructor.- Parameters:
methodInfo-- Throws:
ClassNotFoundException
-
resolveField
- Throws:
ClassNotFoundException
-
accessFlags2Access
-