Package aQute.libg.classdump
Class ClassDumper
java.lang.Object
aQute.libg.classdump.ClassDumper
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) static final int(package private) static final int(package private) static final intACC_PUBLIC 0x0001 Declared public; may be accessed from outside its package.(package private) static final int(package private) static final String(package private) InputStream(package private) static final String(package private) final String(package private) Object[](package private) PrintStream(package private) static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voiddoAnnotation(DataInputStream in, String indent) private voiddoAnnotations(DataInputStream in, String indent) private voiddoAttribute(DataInputStream in, String indent) Process a single attribute, if not recognized, skip it.private voiddoAttributes(DataInputStream in, String indent) Called for each attribute in the class, field, or method.private voiddoCode(DataInputStream in, String indent) Code_attribute { u2 attribute_name_index; u4 attribute_length; u2 max_stack; u2 max_locals; u4 code_length; u1 code[code_length]; u2 exception_table_length; { u2 start_pc; u2 end_pc; u2 handler_pc; u2 catch_type; } exception_table[exception_table_length]; u2 attributes_count; attribute_info attributes[attributes_count]; }private voiddoElementValue(DataInputStream in, String indent) (package private) voiddoEnclosingMethod(DataInputStream in, String indent) EnclosingMethod_attribute { u2 attribute_name_index; u4 attribute_length; u2 class_index u2 method_index; }private voiddoExceptions(DataInputStream in, String indent) Exceptions_attribute { u2 attribute_name_index; u4 attribute_length; u2 number_of_exceptions; u2 exception_index_table[number_of_exceptions]; }(package private) voiddoInnerClasses(DataInputStream in, String indent) InnerClasses_attribute { u2 attribute_name_index; u4 attribute_length; u2 number_of_classes; { u2 inner_class_info_index; u2 outer_class_info_index; u2 inner_name_index; u2 inner_class_access_flags; } classes[number_of_classes]; }(package private) voiddoLineNumberTable(DataInputStream in, String indent) LineNumberTable_attribute { u2 attribute_name_index; u4 attribute_length; u2 line_number_table_length; { u2 start_pc; u2 line_number; } line_number_table[line_number_table_length]; }(package private) voiddoLocalVariableTable(DataInputStream in, String indent) LocalVariableTable_attribute { u2 attribute_name_index; u4 attribute_length; u2 local_variable_table_length; { u2 start_pc; u2 length; u2 name_index; u2 descriptor_index; u2 index; } local_variable_table[local_variable_table_length]; }(package private) voiddoSignature(DataInputStream in, String indent) Signature_attribute { u2 attribute_name_index; u4 attribute_length; u2 signature_index; }private voiddoSourceFile(DataInputStream in, String indent) voiddump(PrintStream ps) static void(package private) void(package private) voidprintAccess(int mod) (package private) voidprintClassAccess(int mod) protected voidprintHex(byte[] code) We must find Class.forName references ...
-
Field Details
-
ACC_PUBLIC
static final int ACC_PUBLICACC_PUBLIC 0x0001 Declared public; may be accessed from outside its package. ACC_FINAL 0x0010 Declared final; no subclasses allowed. ACC_SUPER 0x0020 Treat superclass methods specially when invoked by the invokespecial instruction. ACC_INTERFACE 0x0200 Is an interface, not a class. ACC_ABSTRACT 0x0400 Declared abstract; may not be instantiated.
- See Also:
-
ACC_FINAL
static final int ACC_FINAL- See Also:
-
ACC_SUPER
static final int ACC_SUPER- See Also:
-
ACC_INTERFACE
static final int ACC_INTERFACE- See Also:
-
ACC_ABSTRACT
static final int ACC_ABSTRACT- See Also:
-
path
-
NUM_COLUMN
- See Also:
-
HEX_COLUMN
- See Also:
-
STR_COLUMN
- See Also:
-
ps
PrintStream ps -
pool
Object[] pool -
in
InputStream in
-
-
Constructor Details
-
ClassDumper
- Throws:
Exception
-
ClassDumper
- Throws:
IOException
-
-
Method Details
-
dump
- Throws:
Exception
-
parseClassFile
- Throws:
IOException
-
doAttributes
Called for each attribute in the class, field, or method.- Parameters:
in- The stream- Throws:
IOException
-
doAttribute
Process a single attribute, if not recognized, skip it.- Parameters:
in- the data stream- Throws:
IOException
-
doSignature
Signature_attribute { u2 attribute_name_index; u4 attribute_length; u2 signature_index; }- Parameters:
in-indent-- Throws:
IOException
-
doEnclosingMethod
EnclosingMethod_attribute { u2 attribute_name_index; u4 attribute_length; u2 class_index u2 method_index; }- Throws:
IOException
-
doExceptions
Exceptions_attribute { u2 attribute_name_index; u4 attribute_length; u2 number_of_exceptions; u2 exception_index_table[number_of_exceptions]; }- Parameters:
in-indent-- Throws:
IOException
-
doCode
Code_attribute { u2 attribute_name_index; u4 attribute_length; u2 max_stack; u2 max_locals; u4 code_length; u1 code[code_length]; u2 exception_table_length; { u2 start_pc; u2 end_pc; u2 handler_pc; u2 catch_type; } exception_table[exception_table_length]; u2 attributes_count; attribute_info attributes[attributes_count]; }- Throws:
IOException
-
printHex
protected void printHex(byte[] code) We must find Class.forName references ...- Parameters:
code-
-
doSourceFile
- Throws:
IOException
-
doAnnotations
- Throws:
IOException
-
doAnnotation
- Throws:
IOException
-
doElementValue
- Throws:
IOException
-
doLineNumberTable
LineNumberTable_attribute { u2 attribute_name_index; u4 attribute_length; u2 line_number_table_length; { u2 start_pc; u2 line_number; } line_number_table[line_number_table_length]; }- Throws:
IOException
-
doLocalVariableTable
LocalVariableTable_attribute { u2 attribute_name_index; u4 attribute_length; u2 local_variable_table_length; { u2 start_pc; u2 length; u2 name_index; u2 descriptor_index; u2 index; } local_variable_table[local_variable_table_length]; }- Throws:
IOException
-
doInnerClasses
InnerClasses_attribute { u2 attribute_name_index; u4 attribute_length; u2 number_of_classes; { u2 inner_class_info_index; u2 outer_class_info_index; u2 inner_name_index; u2 inner_class_access_flags; } classes[number_of_classes]; }- Throws:
IOException
-
printClassAccess
void printClassAccess(int mod) -
printAccess
void printAccess(int mod) -
main
- Throws:
Exception
-