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 classprivate final class(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<SourceAttribute> private final ConstantPool.TypeInfoEntryprivate final Bufferprivate final ConstantPoolprivate final List<ClassFileReader.FieldInfo> private final ConstantPool.TypeInfoEntry[]private final Stringprivate final List<ClassFileReader.MethodInfo> private final intprivate final MetadataParserprivate final IMetadataResolverprivate final ClassFileReader.ResolverFrameprivate final ClassFileReader.Scopeprivate final TypeDefinition(package private) static final longprivate static final MethodHandleType[]static final intstatic final intstatic final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateClassFileReader(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 voidprivate voidprivate booleancheckSealed0(TypeReference type) private voidprotected IMetadataScopegetScope()private voidprivate voidprivate voidprivate voidprivate voidprivate voidprotected SourceAttributereadAttributeCore(String name, Buffer buffer, int originalOffset, int length) Reads aSourceAttributefrom the specified buffer.private voidreadAttributesPhaseOne(Buffer buffer, SourceAttribute[] attributes) (package private) final TypeDefinitionstatic TypeDefinitionreadClass(int options, IMetadataResolver resolver, Buffer b) static TypeDefinitionreadClass(IMetadataResolver resolver, Buffer b) private voidreadMethodBody(ClassFileReader.MethodInfo methodInfo, MethodDefinition methodDefinition) protected final ModuleDependencyreadModuleDependency(Buffer buffer) protected final PackageInforeadPackageInfo(Buffer buffer) protected final ServiceInforeadServiceInfo(Buffer buffer) protected booleanprotected booleanprivate IMethodSignaturetryParseMethodSignature(String signature, IMethodSignature fallback) private TypeReferencetryParseTypeSignature(String signature, String fallback) private voidprivate voidMethods inherited from class 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:
getScopein classMetadataReader
-
getParser
- Specified by:
getParserin classMetadataReader
-
readAttributeCore
protected SourceAttribute readAttributeCore(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
-
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()
-