Package org.objectweb.asm.test
Class ClassFile
- java.lang.Object
-
- org.objectweb.asm.test.ClassFile
-
public class ClassFile extends java.lang.Object
A Java class file, whose content can be returned as a verbose, human "readable" string. As an example, the string representation of the HelloWorld class, obtained with thetoString()
method, is:magic: -889275714 minor_version: 0 major_version: 49 access_flags: 33 this_class: ConstantClassInfo HelloWorld super_class: ConstantClassInfo java/lang/Object interfaces_count: 0 fields_count: 0 methods_count: 2 access_flags: 1 name_index: <init> descriptor_index: ()V attributes_count: 1 attribute_name_index: Code max_stack: 1 max_locals: 1 0: 25 0 1: 183 ConstantMethodRefInfo java/lang/Object.<init>()V 2: 177 exception_table_length: 0 attributes_count: 2 attribute_name_index: LineNumberTable line_number_table_length: 1 start_pc: <0> line_number: 31 attribute_name_index: LocalVariableTable local_variable_table_length: 1 start_pc: <0> length: <3> name_index: this descriptor_index: LHelloWorld; index: 0 access_flags: 9 name_index: main descriptor_index: ([Ljava/lang/String;)V attributes_count: 1 attribute_name_index: Code max_stack: 2 max_locals: 1 0: 178 ConstantFieldRefInfo java/lang/System.outLjava/io/PrintStream; 1: 18 ConstantStringInfo Hello, world! 2: 182 ConstantMethodRefInfo java/io/PrintStream.println(Ljava/lang/String;)V 3: 177 exception_table_length: 0 attributes_count: 2 attribute_name_index: LineNumberTable line_number_table_length: 2 start_pc: <0> line_number: 33 start_pc: <3> line_number: 34 attribute_name_index: LocalVariableTable local_variable_table_length: 1 start_pc: <0> length: <4> name_index: args descriptor_index: [Ljava/lang/String; index: 0 attributes_count: 1 attribute_name_index: SourceFile sourcefile_index: HelloWorld.java
This class is used to compare classes in unit tests. Its source code is as close as possible to the Java Virtual Machine specification for ease of reference. The constant pool and bytecode offsets are abstracted away so that two classes which differ only by their constant pool or low level byte code instruction representation (e.g. a ldc vs. a ldc_w) are still considered equal. Likewise, attributes (resp. type annotations) are re-ordered into alphabetical order, so that two classes which differ only via the ordering of their attributes (resp. type annotations) are still considered equal.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ClassFile.AbstractBuilder<T>
A helper class to build the dump of a class file.private static class
ClassFile.Builder
AnClassFile.AbstractBuilder
with concrete methods to add children.private static class
ClassFile.ByteClassLoader
A simple ClassLoader to test that a class can be loaded in the JVM.private static interface
ClassFile.ClassContext
A context to lookup constant pool items from their index.private static class
ClassFile.ConstantClassInfo
A CONSTANT_Class_info item.private static class
ClassFile.ConstantDoubleInfo
A CONSTANT_Double_info item.private static class
ClassFile.ConstantDynamicInfo
A CONSTANT_Dynamic_info item.private static class
ClassFile.ConstantFieldRefInfo
A CONSTANT_Fieldref_info item.private static class
ClassFile.ConstantFloatInfo
A CONSTANT_Float_info item.private static class
ClassFile.ConstantIntegerInfo
A CONSTANT_Integer_info item.private static class
ClassFile.ConstantInterfaceMethodRefInfo
A CONSTANT_InterfaceMethodref_info item.private static class
ClassFile.ConstantInvokeDynamicInfo
A CONSTANT_InvokeDynamic_info item.private static class
ClassFile.ConstantLongInfo
A CONSTANT_Long_info item.private static class
ClassFile.ConstantMethodHandleInfo
A CONSTANT_MethodHandle_info item.private static class
ClassFile.ConstantMethodRefInfo
A CONSTANT_Methodref_info item.private static class
ClassFile.ConstantMethodTypeInfo
A CONSTANT_MethodType_info item.private static class
ClassFile.ConstantModuleInfo
A CONSTANT_Module_info item.private static class
ClassFile.ConstantNameAndTypeInfo
A CONSTANT_NameAndType_info item.private static class
ClassFile.ConstantPackageInfo
A CONSTANT_Package_info item.private static class
ClassFile.ConstantStringInfo
A CONSTANT_String_info item.private static class
ClassFile.ConstantUtf8Info
A CONSTANT_Utf8_info item.private static class
ClassFile.CpInfo
An abstract constant pool item.private static class
ClassFile.InstructionIndex
The index of a bytecode instruction.private static interface
ClassFile.MethodContext
A context to lookup instruction indices from their bytecode offset.private static class
ClassFile.Parser
A simple byte array parser.private static class
ClassFile.SortedBuilder
AnClassFile.AbstractBuilder
which sorts its children by name before building.
-
Field Summary
Fields Modifier and Type Field Description private byte[]
classBytes
The binary content of a Java class file.private java.lang.String
className
The name of the class contained in this class file, lazily computed.private java.lang.String
constantPoolDump
The dump of the constant pool ofclassBytes
, lazily computed.private java.lang.String
dump
The dump ofclassBytes
, lazily computed.(package private) static java.lang.String
MODULE_INFO
The name of JDK9 module classes.
-
Constructor Summary
Constructors Constructor Description ClassFile(byte[] classBytes)
Constructs a new ClassFile instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
computeNameAndDumps()
Computes the name and the string representation of the class (and of its constant pool) contained in this class file.private static void
dumpAnnotation(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps an annotations structure.private static void
dumpAnnotationDefaultAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps an AnnotationDefault attribute.private static void
dumpAttributeInfo(ClassFile.Parser parser, ClassFile.SortedBuilder sortedBuilder)
Parses and dumps an attribute_info structure.private static void
dumpAttributeList(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a list of attributes.private static void
dumpBootstrapMethodsAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a BootstrapMethods attribute.private static ClassFile.ConstantClassInfo
dumpClassFile(ClassFile.Parser parser, ClassFile.Builder builder, ClassFile.Builder constantPoolBuilder)
Parses and dumps the high level structure of the class.private static void
dumpCodeAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a Code attribute.private static void
dumpConstantValueAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a ConstantValue attribute.private static void
dumpDeprecatedAttribute()
Parses and dumps a Deprecated attribute.private static void
dumpElementValue(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps an element_value structure.private static void
dumpEnclosingMethodAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps an EnclosingMethod attribute.private static void
dumpExceptionsAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps an Exception attribute.private static void
dumpFieldInfo(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a field_info structure.private static void
dumpInnerClassesAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps an InnerClasses attribute.private static void
dumpInstructions(int codeLength, ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps the bytecode instructions of a method.private static void
dumpLineNumberTableAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a LineNumberTable attribute.private static void
dumpLocalVariableTableAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a LocalVariableTable attribute.private static void
dumpLocalVariableTypeTableAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a LocalVariableTypeTable attribute.private static void
dumpMethodInfo(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a method_info structure.private static void
dumpMethodParametersAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a MethodParameters attribute.private static void
dumpModuleAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a Module attribute.private static void
dumpModuleMainClassAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a ModuleMainClass attribute.private static void
dumpModulePackagesAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a ModulePackages attribute.private static void
dumpNestHostAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a NestHost attribute.private static void
dumpNestMembersAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a NestMembers attribute.private static void
dumpPermittedSubtypesAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a PermittedSubtypes attribute.private static void
dumpRecordAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a Record attribute.private static void
dumpRuntimeInvisibleAnnotationsAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a RuntimeInvisibleAnnotations attribute.private static void
dumpRuntimeInvisibleParameterAnnotationsAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a RuntimeInvisibleParameterAnnotations attribute.private static void
dumpRuntimeInvisibleTypeAnnotationsAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a RuntimeInvisibleTypeAnnotations attribute.private static void
dumpRuntimeVisibleAnnotationsAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a RuntimeVisibleAnnotations attribute.private static void
dumpRuntimeVisibleParameterAnnotationsAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a RuntimeVisibleParameterAnnotations attribute.private static void
dumpRuntimeVisibleTypeAnnotationsAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a RuntimeVisibleTypeAnnotations attribute.private static void
dumpSignatureAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a Signature attribute.private static void
dumpSourceDebugAttribute(int attributeLength, ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a SourceDebug attribute.private static void
dumpSourceFileAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a SourceFile attribute.private static void
dumpStackMapAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a StackMap attribute.private static void
dumpStackMapTableAttribute(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a StackMapTable attribute.private static void
dumpSyntheticAttribute()
Parses and dumps a Synthetic attribute.private static void
dumpTypeAnnotation(ClassFile.Parser parser, ClassFile.SortedBuilder sortedBuilder)
Parses and dumps a type_annotation structure.private static void
dumpTypePath(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a type_path structure.private static void
dumpVerificationTypeInfo(ClassFile.Parser parser, ClassFile.Builder builder)
Parses and dumps a verification_type_info structure.boolean
equals(java.lang.Object other)
Returns whether the given class file is the same as this one.java.lang.String
getConstantPoolDump()
Returns a string representation of the constant pool of the class contained in this class file.int
hashCode()
Returns the hashcode of this class file.java.lang.Object
newInstance()
Returns a new instance of the class contained in this class file.(package private) static java.lang.Object
newInstance(java.lang.String className, byte[] classContent)
Returns a new instance of the given class.private static ClassFile.CpInfo
parseCpInfo(ClassFile.Parser parser, ClassFile.ClassContext classContext)
Parses a cp_info structure.java.lang.String
toString()
Returns a string representation of this class file.
-
-
-
Field Detail
-
MODULE_INFO
static final java.lang.String MODULE_INFO
The name of JDK9 module classes.- See Also:
- Constant Field Values
-
classBytes
private final byte[] classBytes
The binary content of a Java class file.
-
className
private java.lang.String className
The name of the class contained in this class file, lazily computed.
-
constantPoolDump
private java.lang.String constantPoolDump
The dump of the constant pool ofclassBytes
, lazily computed.
-
dump
private java.lang.String dump
The dump ofclassBytes
, lazily computed.
-
-
Method Detail
-
getConstantPoolDump
public java.lang.String getConstantPoolDump()
Returns a string representation of the constant pool of the class contained in this class file.- Returns:
- a string representation of the constant pool of the class contained in this class file.
-
newInstance
public java.lang.Object newInstance() throws java.lang.ReflectiveOperationException
Returns a new instance of the class contained in this class file. The class is loaded in a new class loader.- Returns:
- a new instance of the class, or null if the class is abstract, is an enum, or a module info.
- Throws:
java.lang.ReflectiveOperationException
- if the class is invalid or if an error occurs in its constructor.
-
newInstance
static java.lang.Object newInstance(java.lang.String className, byte[] classContent) throws java.lang.ReflectiveOperationException
Returns a new instance of the given class. The class is loaded in a new class loader.- Parameters:
className
- the name of the class to load.classContent
- the content of the class to load.- Returns:
- a new instance of the class, or null if the class is abstract, is an enum, or a module info.
- Throws:
java.lang.ReflectiveOperationException
- if the class is invalid or if an error occurs in its constructor.
-
equals
public boolean equals(java.lang.Object other)
Returns whether the given class file is the same as this one.- Overrides:
equals
in classjava.lang.Object
- Returns:
- true if 'other' is a
ClassFile
with the same string representation. - Throws:
ClassFormatException
- if the class content can't be parsed.
-
hashCode
public int hashCode()
Returns the hashcode of this class file.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the hashcode of the string representation of this class file.
- Throws:
ClassFormatException
- if the class content can't be parsed.
-
toString
public java.lang.String toString()
Returns a string representation of this class file.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this class file (see the class comments for more details).
- Throws:
ClassFormatException
- if the class content can't be parsed.
-
computeNameAndDumps
private void computeNameAndDumps()
Computes the name and the string representation of the class (and of its constant pool) contained in this class file.- Throws:
ClassFormatException
- if the class content can't be parsed.
-
dumpClassFile
private static ClassFile.ConstantClassInfo dumpClassFile(ClassFile.Parser parser, ClassFile.Builder builder, ClassFile.Builder constantPoolBuilder) throws java.io.IOException
Parses and dumps the high level structure of the class.- Parameters:
parser
- a class parser.builder
- a dump builder.constantPoolBuilder
- a dump builder for the constant pool.- Returns:
- the ConstantClassInfo corresponding to the parsed class.
- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.1
-
dumpAttributeList
private static void dumpAttributeList(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a list of attributes.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.1
-
parseCpInfo
private static ClassFile.CpInfo parseCpInfo(ClassFile.Parser parser, ClassFile.ClassContext classContext) throws java.io.IOException
Parses a cp_info structure.- Parameters:
parser
- a class parser.classContext
- a context to lookup constant pool items from their index.- Returns:
- the parsed constant pool item.
- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.4
-
dumpFieldInfo
private static void dumpFieldInfo(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a field_info structure.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.5
-
dumpMethodInfo
private static void dumpMethodInfo(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a method_info structure.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.6
-
dumpAttributeInfo
private static void dumpAttributeInfo(ClassFile.Parser parser, ClassFile.SortedBuilder sortedBuilder) throws java.io.IOException
Parses and dumps an attribute_info structure.- Parameters:
parser
- a class parser.sortedBuilder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7
-
dumpConstantValueAttribute
private static void dumpConstantValueAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a ConstantValue attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.2
-
dumpCodeAttribute
private static void dumpCodeAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a Code attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.3
-
dumpInstructions
private static void dumpInstructions(int codeLength, ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps the bytecode instructions of a method.- Parameters:
codeLength
- the number of bytes to parse.parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 6.5
-
dumpStackMapTableAttribute
private static void dumpStackMapTableAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a StackMapTable attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.4
-
dumpVerificationTypeInfo
private static void dumpVerificationTypeInfo(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a verification_type_info structure.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.2
-
dumpExceptionsAttribute
private static void dumpExceptionsAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps an Exception attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.5
-
dumpInnerClassesAttribute
private static void dumpInnerClassesAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps an InnerClasses attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.6
-
dumpEnclosingMethodAttribute
private static void dumpEnclosingMethodAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps an EnclosingMethod attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.7
-
dumpSyntheticAttribute
private static void dumpSyntheticAttribute()
Parses and dumps a Synthetic attribute.- See Also:
- JVMS 4.7.8
-
dumpSignatureAttribute
private static void dumpSignatureAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a Signature attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.9
-
dumpSourceFileAttribute
private static void dumpSourceFileAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a SourceFile attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.10
-
dumpSourceDebugAttribute
private static void dumpSourceDebugAttribute(int attributeLength, ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a SourceDebug attribute.- Parameters:
attributeLength
- the length of the SourceDebug attribute (excluding its 6 header bytes).parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.11
-
dumpLineNumberTableAttribute
private static void dumpLineNumberTableAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a LineNumberTable attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.12
-
dumpLocalVariableTableAttribute
private static void dumpLocalVariableTableAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a LocalVariableTable attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.13
-
dumpLocalVariableTypeTableAttribute
private static void dumpLocalVariableTypeTableAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a LocalVariableTypeTable attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.14
-
dumpDeprecatedAttribute
private static void dumpDeprecatedAttribute()
Parses and dumps a Deprecated attribute.- See Also:
- JVMS 4.7.15
-
dumpRuntimeVisibleAnnotationsAttribute
private static void dumpRuntimeVisibleAnnotationsAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a RuntimeVisibleAnnotations attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.16
-
dumpAnnotation
private static void dumpAnnotation(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps an annotations structure.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.16
-
dumpElementValue
private static void dumpElementValue(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps an element_value structure.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.16.1
-
dumpRuntimeInvisibleAnnotationsAttribute
private static void dumpRuntimeInvisibleAnnotationsAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a RuntimeInvisibleAnnotations attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.17
-
dumpRuntimeVisibleParameterAnnotationsAttribute
private static void dumpRuntimeVisibleParameterAnnotationsAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a RuntimeVisibleParameterAnnotations attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.18
-
dumpRuntimeInvisibleParameterAnnotationsAttribute
private static void dumpRuntimeInvisibleParameterAnnotationsAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a RuntimeInvisibleParameterAnnotations attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.19
-
dumpRuntimeVisibleTypeAnnotationsAttribute
private static void dumpRuntimeVisibleTypeAnnotationsAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a RuntimeVisibleTypeAnnotations attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.20
-
dumpTypeAnnotation
private static void dumpTypeAnnotation(ClassFile.Parser parser, ClassFile.SortedBuilder sortedBuilder) throws java.io.IOException
Parses and dumps a type_annotation structure.- Parameters:
parser
- a class parser.sortedBuilder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.20
-
dumpTypePath
private static void dumpTypePath(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a type_path structure.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.20.2
-
dumpRuntimeInvisibleTypeAnnotationsAttribute
private static void dumpRuntimeInvisibleTypeAnnotationsAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a RuntimeInvisibleTypeAnnotations attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.21
-
dumpAnnotationDefaultAttribute
private static void dumpAnnotationDefaultAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps an AnnotationDefault attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.22
-
dumpBootstrapMethodsAttribute
private static void dumpBootstrapMethodsAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a BootstrapMethods attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.23
-
dumpMethodParametersAttribute
private static void dumpMethodParametersAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a MethodParameters attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.24
-
dumpModuleAttribute
private static void dumpModuleAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a Module attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.25
-
dumpModulePackagesAttribute
private static void dumpModulePackagesAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a ModulePackages attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.26
-
dumpModuleMainClassAttribute
private static void dumpModuleMainClassAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a ModuleMainClass attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.27
-
dumpNestHostAttribute
private static void dumpNestHostAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a NestHost attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.28
-
dumpNestMembersAttribute
private static void dumpNestMembersAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a NestMembers attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JVMS 4.7.29
-
dumpPermittedSubtypesAttribute
private static void dumpPermittedSubtypesAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a PermittedSubtypes attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JEP 360
-
dumpRecordAttribute
private static void dumpRecordAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a Record attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- JEP 360
-
dumpStackMapAttribute
private static void dumpStackMapAttribute(ClassFile.Parser parser, ClassFile.Builder builder) throws java.io.IOException
Parses and dumps a StackMap attribute.- Parameters:
parser
- a class parser.builder
- a dump builder.- Throws:
java.io.IOException
- if the class can't be parsed.- See Also:
- CLDC
-
-