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 CFVersion
private Path
protected String
protected String
protected Container<InnerClassData>
protected int[]
protected Container<MethodData>
protected ModuleData
protected NestHostData
protected NestMembersData
protected String
protected PermittedSubclassesData
protected PreloadData
protected RecordData
protected SourceDebugExtensionData
protected 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.0private TextLines
protected int
protected int
Fields inherited from class org.openjdk.asmtools.jdis.MemberData
access, attributes, data, DEFAULT_VALUE_PREFIX, environment, invisibleAnnotations, invisibleTypeAnnotations, isDeprecated, isSynthetic, memberType, pool, signature, visibleAnnotations, visibleTypeAnnotations
Fields 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 boolean
handleAttributes
(DataInputStream in, EAttribute attributeTag, int attributeLength) Read and resolve the attribute databoolean
Determines if this Class has a packageprivate void
initClassNames
(int this_cpx) Initializes class, package names needed for printing asm fileprivate <P extends Printable>
booleanisPrintable
(P... attributes) void
print()
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 boolean
printMemberDataList
(List<? extends MemberData> list, int commentOffset) Prints list of either fields or methodsvoid
read
(DataInputStream in, Path src) Read and resolve the class datavoid
void
protected void
Read and resolve the field dataprotected void
Read and resolve the interface dataprotected void
Read and resolve the method dataMethods inherited from class org.openjdk.asmtools.jdis.MemberData
getAnnotationElementState, getAnnotationsCount, getConstantPool, getPseudoFlagsAsString, init, printAnnotations, printVar, readAttributes, setElementState
Methods 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, setTheSame
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
handleAttributes
in 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:
print
in interfacePrintable
- Overrides:
print
in 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
-