- java.lang.Object
-
- de.carne.mcd.jvmdecoder.classfile.ClassPrinter
-
public abstract class ClassPrinter extends java.lang.ObjectClass file printing code responsible for presenting all kind decoded class information.
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassInfoclassInfoprotected java.lang.StringclassPackageprotected de.carne.mcd.io.MCDOutputBufferoutstatic java.lang.StringS_ABSTRACT"abstract"static java.lang.StringS_ANNOTATION"@interface"static java.lang.StringS_BOOLEAN"boolean"static java.lang.StringS_BRIDGE"bridge"static java.lang.StringS_BYTE"byte"static java.lang.StringS_CHAR"char"static java.lang.StringS_CLASS"class"static java.lang.StringS_DEPRECATED"@Deprecated"static java.lang.StringS_DOUBLE"double"static java.lang.StringS_ENUM"enum"static java.lang.StringS_EXPORTS"exports"static java.lang.StringS_EXTENDS"extends"static java.lang.StringS_FINAL"final"static java.lang.StringS_FLOAT"float"static java.lang.StringS_IMPLEMENTS"package"static java.lang.StringS_INT"int"static java.lang.StringS_INTERFACE"interface"static java.lang.StringS_LONG"long"static java.lang.StringS_MANDATED"mandated"static java.lang.StringS_MODULE"module"static java.lang.StringS_NATIVE"native"static java.lang.StringS_OPEN"open"static java.lang.StringS_OPENS"opens"static java.lang.StringS_PACKAGE"package"static java.lang.StringS_PRIVATE"private"static java.lang.StringS_PROTECTED"protected"static java.lang.StringS_PROVIDES"provides"static java.lang.StringS_PUBLIC"public"static java.lang.StringS_REQUIRES"requires"static java.lang.StringS_SHORT"short"static java.lang.StringS_STATIC"static"static java.lang.StringS_SUPER"super"static java.lang.StringS_SYNCHRONIZED"synchronized"static java.lang.StringS_SYNTHETIC"synthetic"static java.lang.StringS_THROWS"implements"static java.lang.StringS_TO"to"static java.lang.StringS_TRANSIENT"transient"static java.lang.StringS_TRANSITIVE"transitive"static java.lang.StringS_USES"uses"static java.lang.StringS_VARARGS"varargs"static java.lang.StringS_VOID"void"static java.lang.StringS_VOLATILE"volatile"static java.lang.StringS_WITH"with"
-
Constructor Summary
Constructors Modifier Constructor Description protectedClassPrinter(de.carne.mcd.io.MCDOutputBuffer out, ClassInfo classInfo)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ClassPrintergetInstance(de.carne.mcd.io.MCDOutputBuffer out, ClassInfo classInfo)Gets a ClassPrinter instance suitable for printing the submitted class information.de.carne.mcd.io.MCDOutputBufferoutput()Gets the underlying MCDOutputBuffer instance.abstract voidprint()Prints the class information.ClassPrinterprint(java.lang.String text)Prints a standard text.protected voidprintAnnotations(java.util.List<Attribute> attributes, ClassContext context)protected voidprintClassAnnotation()protected voidprintClassComment()protected voidprintClassPackage()protected voidprintClassSignature(java.lang.String classKeyword)ClassPrinterprintComment(java.lang.String comment)Prints a comment text.protected voidprintFields()voidprintFlagsComment(java.util.Map<java.lang.Integer,java.lang.String> flagSymbols, int flags)Prints flag symbols as comment.voidprintFlagsKeyword(java.util.Map<java.lang.Integer,java.lang.String> flagSymbols, int flags)Prints flag symbols as keywords.ClassPrinterprintKeyword(java.lang.String keyword)Prints a keyword text.ClassPrinterprintLabel(java.lang.String label)Prints a label text.ClassPrinterprintln()Prints a line break.ClassPrinterprintln(java.lang.String text)Prints a standard text and a line break.ClassPrinterprintlnComment(java.lang.String comment)Prints a comment text and a line break.ClassPrinterprintlnKeyword(java.lang.String keyword)Prints a keyword text and a line break.ClassPrinterprintlnLabel(java.lang.String label)Prints a label text and a line break.ClassPrinterprintlnOperator(java.lang.String operator)Prints an operator text and a line break.ClassPrinterprintlnValue(java.lang.String value)Prints a value text and a line break.protected voidprintMethods()protected voidprintModuleInfo()ClassPrinterprintOperator(java.lang.String operator)Prints an operator text.ClassPrinterprintValue(java.lang.String value)Prints a value text.
-
-
-
Field Detail
-
S_MODULE
public static final java.lang.String S_MODULE
"module"- See Also:
- Constant Field Values
-
S_PACKAGE
public static final java.lang.String S_PACKAGE
"package"- See Also:
- Constant Field Values
-
S_CLASS
public static final java.lang.String S_CLASS
"class"- See Also:
- Constant Field Values
-
S_INTERFACE
public static final java.lang.String S_INTERFACE
"interface"- See Also:
- Constant Field Values
-
S_ENUM
public static final java.lang.String S_ENUM
"enum"- See Also:
- Constant Field Values
-
S_ANNOTATION
public static final java.lang.String S_ANNOTATION
"@interface"- See Also:
- Constant Field Values
-
S_REQUIRES
public static final java.lang.String S_REQUIRES
"requires"- See Also:
- Constant Field Values
-
S_EXPORTS
public static final java.lang.String S_EXPORTS
"exports"- See Also:
- Constant Field Values
-
S_OPENS
public static final java.lang.String S_OPENS
"opens"- See Also:
- Constant Field Values
-
S_TO
public static final java.lang.String S_TO
"to"- See Also:
- Constant Field Values
-
S_USES
public static final java.lang.String S_USES
"uses"- See Also:
- Constant Field Values
-
S_PROVIDES
public static final java.lang.String S_PROVIDES
"provides"- See Also:
- Constant Field Values
-
S_WITH
public static final java.lang.String S_WITH
"with"- See Also:
- Constant Field Values
-
S_SUPER
public static final java.lang.String S_SUPER
"super"- See Also:
- Constant Field Values
-
S_EXTENDS
public static final java.lang.String S_EXTENDS
"extends"- See Also:
- Constant Field Values
-
S_IMPLEMENTS
public static final java.lang.String S_IMPLEMENTS
"package"- See Also:
- Constant Field Values
-
S_THROWS
public static final java.lang.String S_THROWS
"implements"- See Also:
- Constant Field Values
-
S_PUBLIC
public static final java.lang.String S_PUBLIC
"public"- See Also:
- Constant Field Values
-
S_PRIVATE
public static final java.lang.String S_PRIVATE
"private"- See Also:
- Constant Field Values
-
S_PROTECTED
public static final java.lang.String S_PROTECTED
"protected"- See Also:
- Constant Field Values
-
S_STATIC
public static final java.lang.String S_STATIC
"static"- See Also:
- Constant Field Values
-
S_FINAL
public static final java.lang.String S_FINAL
"final"- See Also:
- Constant Field Values
-
S_VOLATILE
public static final java.lang.String S_VOLATILE
"volatile"- See Also:
- Constant Field Values
-
S_TRANSIENT
public static final java.lang.String S_TRANSIENT
"transient"- See Also:
- Constant Field Values
-
S_BRIDGE
public static final java.lang.String S_BRIDGE
"bridge"- See Also:
- Constant Field Values
-
S_VARARGS
public static final java.lang.String S_VARARGS
"varargs"- See Also:
- Constant Field Values
-
S_SYNTHETIC
public static final java.lang.String S_SYNTHETIC
"synthetic"- See Also:
- Constant Field Values
-
S_TRANSITIVE
public static final java.lang.String S_TRANSITIVE
"transitive"- See Also:
- Constant Field Values
-
S_OPEN
public static final java.lang.String S_OPEN
"open"- See Also:
- Constant Field Values
-
S_MANDATED
public static final java.lang.String S_MANDATED
"mandated"- See Also:
- Constant Field Values
-
S_SYNCHRONIZED
public static final java.lang.String S_SYNCHRONIZED
"synchronized"- See Also:
- Constant Field Values
-
S_NATIVE
public static final java.lang.String S_NATIVE
"native"- See Also:
- Constant Field Values
-
S_ABSTRACT
public static final java.lang.String S_ABSTRACT
"abstract"- See Also:
- Constant Field Values
-
S_BYTE
public static final java.lang.String S_BYTE
"byte"- See Also:
- Constant Field Values
-
S_CHAR
public static final java.lang.String S_CHAR
"char"- See Also:
- Constant Field Values
-
S_DOUBLE
public static final java.lang.String S_DOUBLE
"double"- See Also:
- Constant Field Values
-
S_FLOAT
public static final java.lang.String S_FLOAT
"float"- See Also:
- Constant Field Values
-
S_INT
public static final java.lang.String S_INT
"int"- See Also:
- Constant Field Values
-
S_LONG
public static final java.lang.String S_LONG
"long"- See Also:
- Constant Field Values
-
S_SHORT
public static final java.lang.String S_SHORT
"short"- See Also:
- Constant Field Values
-
S_BOOLEAN
public static final java.lang.String S_BOOLEAN
"boolean"- See Also:
- Constant Field Values
-
S_VOID
public static final java.lang.String S_VOID
"void"- See Also:
- Constant Field Values
-
S_DEPRECATED
public static final java.lang.String S_DEPRECATED
"@Deprecated"- See Also:
- Constant Field Values
-
out
protected final de.carne.mcd.io.MCDOutputBuffer out
-
classInfo
protected final ClassInfo classInfo
-
classPackage
protected final java.lang.String classPackage
-
-
Constructor Detail
-
ClassPrinter
protected ClassPrinter(de.carne.mcd.io.MCDOutputBuffer out, ClassInfo classInfo)
-
-
Method Detail
-
getInstance
public static ClassPrinter getInstance(de.carne.mcd.io.MCDOutputBuffer out, ClassInfo classInfo)
Gets a ClassPrinter instance suitable for printing the submitted class information.- Parameters:
out- the MCDOutputBuffer to print to.classInfo- the ClassInfo to print.- Returns:
- a ClassPrinter instance suitable for the submitted class information.
-
output
public de.carne.mcd.io.MCDOutputBuffer output()
Gets the underlying MCDOutputBuffer instance.- Returns:
- the underlying MCDOutputBuffer instance.
-
print
public abstract void print() throws java.io.IOExceptionPrints the class information.- Throws:
java.io.IOException- if an I/O error occurs.
-
println
public ClassPrinter println() throws java.io.IOException
Prints a line break.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
print
public ClassPrinter print(java.lang.String text) throws java.io.IOException
Prints a standard text.- Parameters:
text- the text to print.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
println
public ClassPrinter println(java.lang.String text) throws java.io.IOException
Prints a standard text and a line break.- Parameters:
text- the text to print.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
printValue
public ClassPrinter printValue(java.lang.String value) throws java.io.IOException
Prints a value text.- Parameters:
value- the text to print.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
printlnValue
public ClassPrinter printlnValue(java.lang.String value) throws java.io.IOException
Prints a value text and a line break.- Parameters:
value- the text to print.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
printComment
public ClassPrinter printComment(java.lang.String comment) throws java.io.IOException
Prints a comment text.- Parameters:
comment- the text to print.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
printlnComment
public ClassPrinter printlnComment(java.lang.String comment) throws java.io.IOException
Prints a comment text and a line break.- Parameters:
comment- the text to print.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
printKeyword
public ClassPrinter printKeyword(java.lang.String keyword) throws java.io.IOException
Prints a keyword text.- Parameters:
keyword- the text to print.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
printlnKeyword
public ClassPrinter printlnKeyword(java.lang.String keyword) throws java.io.IOException
Prints a keyword text and a line break.- Parameters:
keyword- the text to print.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
printOperator
public ClassPrinter printOperator(java.lang.String operator) throws java.io.IOException
Prints an operator text.- Parameters:
operator- the text to print.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
printlnOperator
public ClassPrinter printlnOperator(java.lang.String operator) throws java.io.IOException
Prints an operator text and a line break.- Parameters:
operator- the text to print.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
printLabel
public ClassPrinter printLabel(java.lang.String label) throws java.io.IOException
Prints a label text.- Parameters:
label- the text to print.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
printlnLabel
public ClassPrinter printlnLabel(java.lang.String label) throws java.io.IOException
Prints a label text and a line break.- Parameters:
label- the text to print.- Returns:
- this instance for chaining.
- Throws:
java.io.IOException- if an I/O error occurs.
-
printFlagsComment
public void printFlagsComment(java.util.Map<java.lang.Integer,java.lang.String> flagSymbols, int flags) throws java.io.IOExceptionPrints flag symbols as comment.- Parameters:
flagSymbols- the flag symbols to use.flags- the flags to print.- Throws:
java.io.IOException- if an I/O error occurs.
-
printFlagsKeyword
public void printFlagsKeyword(java.util.Map<java.lang.Integer,java.lang.String> flagSymbols, int flags) throws java.io.IOExceptionPrints flag symbols as keywords.- Parameters:
flagSymbols- the flag symbols to use.flags- the flags to print.- Throws:
java.io.IOException- if an I/O error occurs.
-
printClassComment
protected void printClassComment() throws java.io.IOException- Throws:
java.io.IOException
-
printClassPackage
protected void printClassPackage() throws java.io.IOException- Throws:
java.io.IOException
-
printClassAnnotation
protected void printClassAnnotation() throws java.io.IOException- Throws:
java.io.IOException
-
printAnnotations
protected void printAnnotations(java.util.List<Attribute> attributes, ClassContext context) throws java.io.IOException
- Throws:
java.io.IOException
-
printModuleInfo
protected void printModuleInfo() throws java.io.IOException- Throws:
java.io.IOException
-
printClassSignature
protected void printClassSignature(java.lang.String classKeyword) throws java.io.IOException- Throws:
java.io.IOException
-
printFields
protected void printFields() throws java.io.IOException- Throws:
java.io.IOException
-
printMethods
protected void printMethods() throws java.io.IOException- Throws:
java.io.IOException
-
-