Package org.openjdk.asmtools.jdis
Class ClassData
- All Implemented Interfaces:
Printable
Central class data for of the Java Disassembler
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openjdk.asmtools.jdis.MemberData
MemberData.AnnotationElementState -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Container<BootstrapMethodData> protected CFVersionprivate Pathprotected Stringprotected Stringprotected Container<InnerClassData> protected int[]protected Container<MethodData> protected ModuleDataprotected NestHostDataprotected NestMembersDataprotected Stringprotected PermittedSubclassesDataprotected PreloadDataprotected RecordDataprotected SourceDebugExtensionDataprotected SourceFileDataAttributes: SourceFile 45.3 InnerClasses 45.3 EnclosingMethod 49.0 SourceDebugExtension 49.0 BootstrapMethods 51.0 Module, ModulePackages, ModuleMainClass 53.0 NestHost, NestMembers 55.0 Record 60.0 PermittedSubclasses 61.0 ------------------------------------------------- Synthetic 45.3 Deprecated 45.3 Signature 49.0 RuntimeVisibleAnnotations 49.0 RuntimeInvisibleAnnotations 49.0 RuntimeVisibleTypeAnnotations 52.0 RuntimeInvisibleTypeAnnotations 52.0private TextLinesprotected intprotected intFields inherited from class org.openjdk.asmtools.jdis.MemberData
access, attributes, data, DEFAULT_VALUE_PREFIX, environment, invisibleAnnotations, invisibleTypeAnnotations, isDeprecated, isSynthetic, memberType, pool, signature, visibleAnnotations, visibleTypeAnnotationsFields inherited from class org.openjdk.asmtools.jdis.Indenter
ARGUMENT_DELIMITER, COMMENT_OFFSET, COMMENT_PADDING, INDENT_OFFSET, INDENT_STEP, INDENT_STRING, INSTR_PREFIX_LENGTH, LINE_SPLITTER, OPERAND_PLACEHOLDER_LENGTH, printConstantPool, printCPIndex, printHEX, printLabelAsIdentifiers, printLineTable, printLocalVars, printProgramCounter, printSourceLines, PROGRAM_COUNTER_PLACEHOLDER_LENGTH, skipComments, STACKMAP_TYPE_PLACEHOLDER_LENGTH, toolOutput -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetListOfPrintableAttributes(P... attributes) getSrcLine(int lineNum) Read and resolve the attribute dataprotected booleanhandleAttributes(DataInputStream in, EAttribute attributeTag, int attributeLength) Read and resolve the attribute databooleanDetermines if this Class has a packageprivate voidinitClassNames(int this_cpx) Initializes class, package names needed for printing asm fileprivate <P extends Printable>
booleanisPrintable(P... attributes) voidprint()Print asm file.private <T extends AnnotationData>
voidprintAnnotations(List<T>... annotationLists) private <P extends Printable>
intprintAttributes(int commentOffset, List<P> attributeList) Returns number of corrupted attributes if anyprivate booleanprintMemberDataList(List<? extends MemberData> list, int commentOffset) Prints list of either fields or methodsvoidread(DataInputStream in, Path src) Read and resolve the class datavoidvoidprotected voidRead and resolve the field dataprotected voidRead and resolve the interface dataprotected voidRead and resolve the method dataMethods inherited from class org.openjdk.asmtools.jdis.MemberData
getAnnotationElementState, getAnnotationsCount, getConstantPool, getPseudoFlagsAsString, init, printAnnotations, printVar, readAttributes, setElementStateMethods inherited from class org.openjdk.asmtools.jdis.Indenter
decIndent, enlargedIndent, enlargedIndent, getCommentOffset, getIndentSize, getIndentStep, getIndentString, getOffset, incIndent, Indent, IndentPadLeft, IndentPadRight, initIndent, nCopies, padLeft, PadLeft, padRight, PadRight, print, print, printIndent, printIndent, printIndent, printIndentLn, printIndentLn, printIndentLn, printIndentPadRight, println, println, println, println, printPadLeft, printPadRight, resetIndent, setCommentOffset, setOffset, setTheSameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openjdk.asmtools.jdis.Printable
isPrintable
-
Field Details
-
cfVersion
-
this_cpx
protected int this_cpx -
className
-
packageName
-
classShortName
-
super_cpx
protected int super_cpx -
interfaces
protected int[] interfaces -
fields
-
methods
-
sourceFileData
Attributes: SourceFile 45.3 InnerClasses 45.3 EnclosingMethod 49.0 SourceDebugExtension 49.0 BootstrapMethods 51.0 Module, ModulePackages, ModuleMainClass 53.0 NestHost, NestMembers 55.0 Record 60.0 PermittedSubclasses 61.0 ------------------------------------------------- Synthetic 45.3 Deprecated 45.3 Signature 49.0 RuntimeVisibleAnnotations 49.0 RuntimeInvisibleAnnotations 49.0 RuntimeVisibleTypeAnnotations 52.0 RuntimeInvisibleTypeAnnotations 52.0 -
innerClasses
-
recordData
-
bootstrapMethods
-
moduleData
-
nestHost
-
nestMembers
-
permittedSubclassesData
-
sourceDebugExtensionData
-
preloadData
-
sourceLines
-
classFile
-
-
Constructor Details
-
ClassData
-
-
Method Details
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
readFields
Read and resolve the field data- Throws:
IOException
-
readMethods
Read and resolve the method data- Throws:
IOException
-
readInterfaces
Read and resolve the interface data- Throws:
IOException
-
handleAttributes
protected boolean handleAttributes(DataInputStream in, EAttribute attributeTag, int attributeLength) throws IOException Read and resolve the attribute data- Overrides:
handleAttributesin classMemberData<ClassData>- Throws:
IOException
-
read
Read and resolve the class data- Throws:
IOException
-
initClassNames
private void initClassNames(int this_cpx) Initializes class, package names needed for printing asm file- Parameters:
this_cpx- The constant_pool entry at that index is a CONSTANT_Class_info structure (ยง4.4.1) representing the class or interface defined by this class file or this_class is module-info in the case of a module.
-
hasPackage
public boolean hasPackage()Determines if this Class has a package- Returns:
- true if the package exists for this class
-
getSrcLine
Read and resolve the attribute data -
printAnnotations
@SafeVarargs private <T extends AnnotationData> void printAnnotations(List<T>... annotationLists) throws IOException - Throws:
IOException
-
print
Print asm file.- Specified by:
printin interfacePrintable- Overrides:
printin classIndenter- Throws:
IOException
-
getListOfPrintableAttributes
-
isPrintable
-
printAttributes
private <P extends Printable> int printAttributes(int commentOffset, List<P> attributeList) throws IOException Returns number of corrupted attributes if any- Throws:
IOException
-
getCorruptedAttributes
-
printMemberDataList
private boolean printMemberDataList(List<? extends MemberData> list, int commentOffset) throws IOException Prints list of either fields or methods- Parameters:
list- a list of fields or methods to be printed- Returns:
- true if something were printed
- Throws:
IOException- if something goes wrong
-