Package org.openjdk.asmtools.jdis
Class ClassData
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 ArrayList<BootstrapMethodData>protected CFVersionprivate Pathprotected Stringprotected Stringprotected ArrayList<InnerClassData>protected int[]protected ArrayList<MethodData>protected ModuleDataprotected NestHostDataprotected NestMembersDataprotected Stringprotected PermittedSubclassesDataprotected PreloadDataprotected RecordDataprotected intprivate TextLinesprotected Stringprotected 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, STACKMAP_TYPE_PLACEHOLDER_LENGTH, toolOutput -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSrcLine(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 file(package private) booleanisPrintable(List<?>... lists) (package private) final <T extends Indenter>
booleanisPrintable(T... list) voidprint()Print asm file.private <T extends AnnotationData>
voidprintAnnotations(List<T>... annotationLists) private 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, setTheSame
-
Field Details
-
cfVersion
-
this_cpx
protected int this_cpx -
className
-
packageName
-
classShortName
-
source_cpx
protected int source_cpx -
sourceName
-
super_cpx
protected int super_cpx -
interfaces
protected int[] interfaces -
fields
-
methods
-
recordData
-
innerClasses
-
bootstrapMethods
-
moduleData
-
nestHost
-
nestMembers
-
permittedSubclassesData
-
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.- Overrides:
printin classIndenter- Throws:
IOException
-
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
-
isPrintable
-
isPrintable
-