Package com.strobel.assembler.metadata
Class ClassFileReader
- java.lang.Object
-
- com.strobel.assembler.ir.MetadataReader
-
- com.strobel.assembler.metadata.ClassFileReader
-
public final class ClassFileReader extends MetadataReader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classClassFileReader.FieldInfo(package private) classClassFileReader.MethodInfoprivate classClassFileReader.ResolverFrame(package private) static classClassFileReader.Scope
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<SourceAttribute>_attributesprivate ConstantPool.TypeInfoEntry_baseClassEntryprivate Buffer_bufferprivate ConstantPool_constantPoolprivate java.util.List<ClassFileReader.FieldInfo>_fieldsprivate ConstantPool.TypeInfoEntry[]_interfaceEntriesprivate java.lang.String_internalNameprivate java.util.List<ClassFileReader.MethodInfo>_methodsprivate int_optionsprivate MetadataParser_parserprivate IMetadataResolver_resolverprivate ClassFileReader.ResolverFrame_resolverFrameprivate ClassFileReader.Scope_scopeprivate TypeDefinition_typeDefinition(package private) static longMAGICprivate static MethodHandleType[]METHOD_HANDLE_TYPESstatic intOPTION_PROCESS_ANNOTATIONSstatic intOPTION_PROCESS_CODEstatic intOPTIONS_DEFAULT
-
Constructor Summary
Constructors Modifier Constructor Description privateClassFileReader(int options, IMetadataResolver resolver, int majorVersion, int minorVersion, Buffer buffer, ConstantPool constantPool, int accessFlags, ConstantPool.TypeInfoEntry thisClassEntry, ConstantPool.TypeInfoEntry baseClassEntry, ConstantPool.TypeInfoEntry[] interfaceEntries)
-
Method Summary
-
Methods inherited from class com.strobel.assembler.ir.MetadataReader
inflateAttribute, inflateAttribute, inflateAttributes, inflateAttributes, readAttribute, readAttributes
-
-
-
-
Field Detail
-
OPTION_PROCESS_ANNOTATIONS
public static final int OPTION_PROCESS_ANNOTATIONS
- See Also:
- Constant Field Values
-
OPTION_PROCESS_CODE
public static final int OPTION_PROCESS_CODE
- See Also:
- Constant Field Values
-
OPTIONS_DEFAULT
public static final int OPTIONS_DEFAULT
- See Also:
- Constant Field Values
-
MAGIC
static final long MAGIC
- See Also:
- Constant Field Values
-
_options
private final int _options
-
_resolver
private final IMetadataResolver _resolver
-
_buffer
private final Buffer _buffer
-
_constantPool
private final ConstantPool _constantPool
-
_baseClassEntry
private final ConstantPool.TypeInfoEntry _baseClassEntry
-
_interfaceEntries
private final ConstantPool.TypeInfoEntry[] _interfaceEntries
-
_fields
private final java.util.List<ClassFileReader.FieldInfo> _fields
-
_methods
private final java.util.List<ClassFileReader.MethodInfo> _methods
-
_attributes
private final java.util.List<SourceAttribute> _attributes
-
_internalName
private final java.lang.String _internalName
-
_typeDefinition
private final TypeDefinition _typeDefinition
-
_parser
private final MetadataParser _parser
-
_resolverFrame
private final ClassFileReader.ResolverFrame _resolverFrame
-
_scope
private final ClassFileReader.Scope _scope
-
METHOD_HANDLE_TYPES
private static final MethodHandleType[] METHOD_HANDLE_TYPES
-
-
Constructor Detail
-
ClassFileReader
private ClassFileReader(int options, IMetadataResolver resolver, int majorVersion, int minorVersion, Buffer buffer, ConstantPool constantPool, int accessFlags, ConstantPool.TypeInfoEntry thisClassEntry, ConstantPool.TypeInfoEntry baseClassEntry, ConstantPool.TypeInfoEntry[] interfaceEntries)
-
-
Method Detail
-
shouldProcessAnnotations
protected boolean shouldProcessAnnotations()
-
shouldProcessCode
protected boolean shouldProcessCode()
-
getScope
protected IMetadataScope getScope()
- Specified by:
getScopein classMetadataReader
-
getParser
public MetadataParser getParser()
- Specified by:
getParserin classMetadataReader
-
readAttributeCore
protected SourceAttribute readAttributeCore(java.lang.String name, Buffer buffer, int originalOffset, int length)
Reads aSourceAttributefrom the specified buffer.- Overrides:
readAttributeCorein classMetadataReader- Parameters:
name- The name of the attribute to decode.buffer- A buffer containing the attribute blob.originalOffset- The offset of position 0 in the buffer relative to the start of the original class file. This is needed during lazy inflation ofCodeAttribute(and possibly others). In the case ofCodeAttribute, it is helpful to know exactly where each method's body begins so we can load it on demand at some point in the future.length- The length of the attribute. Implementations should not rely onbuffer.size().
-
readModuleDependency
protected final ModuleDependency readModuleDependency(Buffer buffer)
-
readPackageInfo
protected final PackageInfo readPackageInfo(Buffer buffer)
-
readServiceInfo
protected final ServiceInfo readServiceInfo(Buffer buffer)
-
readAttributesPhaseOne
private void readAttributesPhaseOne(Buffer buffer, SourceAttribute[] attributes)
-
readClass
public static TypeDefinition readClass(IMetadataResolver resolver, Buffer b)
-
readClass
public static TypeDefinition readClass(int options, IMetadataResolver resolver, Buffer b)
-
readClass
final TypeDefinition readClass()
-
checkModuleAttribute
private void checkModuleAttribute()
-
checkEnclosingMethodAttributes
private void checkEnclosingMethodAttributes()
-
populateMemberInfo
private void populateMemberInfo()
-
populateDeclaringType
private void populateDeclaringType()
-
populateBaseTypes
private void populateBaseTypes()
-
populatePermittedSubclasses
private void populatePermittedSubclasses()
-
checkSealed0
private boolean checkSealed0(TypeReference type)
-
populateNamedInnerTypes
private void populateNamedInnerTypes()
-
populateAnonymousInnerTypes
private void populateAnonymousInnerTypes()
-
visitFields
private void visitFields()
-
tryParseTypeSignature
private TypeReference tryParseTypeSignature(java.lang.String signature, java.lang.String fallback)
-
defineMethods
private void defineMethods()
-
tryParseMethodSignature
private IMethodSignature tryParseMethodSignature(java.lang.String signature, IMethodSignature fallback)
-
readMethodBody
private void readMethodBody(ClassFileReader.MethodInfo methodInfo, MethodDefinition methodDefinition)
-
visitAttributes
private void visitAttributes()
-
-