Package com.strobel.assembler.metadata
Class ClassFileReader
java.lang.Object
com.strobel.assembler.ir.MetadataReader
com.strobel.assembler.metadata.ClassFileReader
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) final class
(package private) final class
private final class
(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<SourceAttribute> private final ConstantPool.TypeInfoEntry
private final Buffer
private final ConstantPool
private final List
<ClassFileReader.FieldInfo> private final ConstantPool.TypeInfoEntry[]
private final String
private final List
<ClassFileReader.MethodInfo> private final int
private final MetadataParser
private final IMetadataResolver
private final ClassFileReader.ResolverFrame
private final ClassFileReader.Scope
private final TypeDefinition
(package private) static final long
private static final MethodHandleType[]
static final int
static final int
static final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
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 Summary
Modifier and TypeMethodDescriptionprivate void
private void
private boolean
checkSealed0
(TypeReference type) private void
protected IMetadataScope
getScope()
private void
private void
private void
private void
private void
private void
protected SourceAttribute
readAttributeCore
(String name, Buffer buffer, int originalOffset, int length) Reads aSourceAttribute
from the specified buffer.private void
readAttributesPhaseOne
(Buffer buffer, SourceAttribute[] attributes) (package private) final TypeDefinition
static TypeDefinition
readClass
(int options, IMetadataResolver resolver, Buffer b) static TypeDefinition
readClass
(IMetadataResolver resolver, Buffer b) private void
readMethodBody
(ClassFileReader.MethodInfo methodInfo, MethodDefinition methodDefinition) protected final ModuleDependency
readModuleDependency
(Buffer buffer) protected final PackageInfo
readPackageInfo
(Buffer buffer) protected final ServiceInfo
readServiceInfo
(Buffer buffer) protected boolean
protected boolean
private IMethodSignature
tryParseMethodSignature
(String signature, IMethodSignature fallback) private TypeReference
tryParseTypeSignature
(String signature, String fallback) private void
private void
Methods inherited from class com.strobel.assembler.ir.MetadataReader
inflateAttribute, inflateAttribute, inflateAttributes, inflateAttributes, readAttribute, readAttributes
-
Field Details
-
OPTION_PROCESS_ANNOTATIONS
public static final int OPTION_PROCESS_ANNOTATIONS- See Also:
-
OPTION_PROCESS_CODE
public static final int OPTION_PROCESS_CODE- See Also:
-
OPTIONS_DEFAULT
public static final int OPTIONS_DEFAULT- See Also:
-
MAGIC
static final long MAGIC- See Also:
-
_options
private final int _options -
_resolver
-
_buffer
-
_constantPool
-
_baseClassEntry
-
_interfaceEntries
-
_fields
-
_methods
-
_attributes
-
_internalName
-
_typeDefinition
-
_parser
-
_resolverFrame
-
_scope
-
METHOD_HANDLE_TYPES
-
-
Constructor Details
-
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 Details
-
shouldProcessAnnotations
protected boolean shouldProcessAnnotations() -
shouldProcessCode
protected boolean shouldProcessCode() -
getScope
- Specified by:
getScope
in classMetadataReader
-
getParser
- Specified by:
getParser
in classMetadataReader
-
readAttributeCore
protected SourceAttribute readAttributeCore(String name, Buffer buffer, int originalOffset, int length) Reads aSourceAttribute
from the specified buffer.- Overrides:
readAttributeCore
in 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
-
readPackageInfo
-
readServiceInfo
-
readAttributesPhaseOne
-
readClass
-
readClass
-
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
-
populateNamedInnerTypes
private void populateNamedInnerTypes() -
populateAnonymousInnerTypes
private void populateAnonymousInnerTypes() -
visitFields
private void visitFields() -
tryParseTypeSignature
-
defineMethods
private void defineMethods() -
tryParseMethodSignature
-
readMethodBody
private void readMethodBody(ClassFileReader.MethodInfo methodInfo, MethodDefinition methodDefinition) -
visitAttributes
private void visitAttributes()
-