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 CFVersion
private Path
protected String
protected String
protected ArrayList<InnerClassData>
protected int[]
protected ArrayList<MethodData>
protected ModuleData
protected NestHostData
protected NestMembersData
protected String
protected PermittedSubclassesData
protected PreloadData
protected RecordData
protected int
private TextLines
protected String
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, STACKMAP_TYPE_PLACEHOLDER_LENGTH, toolOutput
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSrcLine
(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 file(package private) boolean
isPrintable
(List<?>... lists) (package private) final <T extends Indenter>
booleanisPrintable
(T... list) void
print()
Print asm file.private <T extends AnnotationData>
voidprintAnnotations
(List<T>... annotationLists) private 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
-
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:
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.- Overrides:
print
in 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
-