Interface ClassFile
- All Superinterfaces:
HasAttribute
- All Known Implementing Classes:
DirectClassFile
Interface for things which purport to be class files or reasonable
facsimiles thereof.
Note: The fields referred to in this documentation are of the
ClassFile structure defined in vmspec-2 sec4.1.
-
Method Summary
Modifier and TypeMethodDescriptionintGets the fieldaccess_flags.Gets the fieldattributes(along withattributes_count).Gets the bootstrap methodattributes.Gets the fieldconstant_pool(along withconstant_pool_count).Gets the fieldfields(along withfields_count).Gets the fieldinterfaces(along withinterfaces_count).intgetMagic()Gets the fieldmagic.intGets the fieldmajor_version.Gets the fieldmethods(along withmethods_count).intGets the fieldminor_version.Gets the name out of theSourceFileattribute of this file, if any.Gets the fieldsuper_class, interpreted as a type constant if non-zero.Gets the fieldthis_class, interpreted as a type constant.
-
Method Details
-
getMagic
int getMagic()Gets the fieldmagic.- Returns:
- the value in question
-
getMinorVersion
int getMinorVersion()Gets the fieldminor_version.- Returns:
- the value in question
-
getMajorVersion
int getMajorVersion()Gets the fieldmajor_version.- Returns:
- the value in question
-
getAccessFlags
int getAccessFlags()Gets the fieldaccess_flags.- Returns:
- the value in question
-
getThisClass
CstType getThisClass()Gets the fieldthis_class, interpreted as a type constant.- Returns:
non-null;the value in question
-
getSuperclass
CstType getSuperclass()Gets the fieldsuper_class, interpreted as a type constant if non-zero.- Returns:
null-ok;the value in question
-
getConstantPool
ConstantPool getConstantPool()Gets the fieldconstant_pool(along withconstant_pool_count).- Returns:
non-null;the constant pool
-
getInterfaces
TypeList getInterfaces()Gets the fieldinterfaces(along withinterfaces_count).- Returns:
non-null;the list of interfaces
-
getFields
FieldList getFields()Gets the fieldfields(along withfields_count).- Returns:
non-null;the list of fields
-
getMethods
MethodList getMethods()Gets the fieldmethods(along withmethods_count).- Returns:
non-null;the list of fields
-
getAttributes
AttributeList getAttributes()Gets the fieldattributes(along withattributes_count).- Specified by:
getAttributesin interfaceHasAttribute- Returns:
non-null;the list of attributes
-
getBootstrapMethods
BootstrapMethodsList getBootstrapMethods()Gets the bootstrap methodattributes.- Returns:
non-null;the list of bootstrap methods
-
getSourceFile
CstString getSourceFile()Gets the name out of theSourceFileattribute of this file, if any. This is a convenient shorthand for scrounging around the class's attributes.- Returns:
non-null;the constant pool
-