Package proguard.classfile.util.renderer
Class ClassViewModel
- java.lang.Object
-
- proguard.classfile.util.renderer.ProcessableViewModel
-
- proguard.classfile.util.renderer.ClassViewModel
-
public class ClassViewModel extends ProcessableViewModel
This utility class rendersClazz
objects into a more human-readable format. It can be used as a Java type renderer in Intellij-based IDE to support debugging.
-
-
Field Summary
-
Fields inherited from class proguard.classfile.util.renderer.ProcessableViewModel
processingFlags, processingInfo
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ClassViewModel
render(Clazz clazz)
RendersClazz
object into an abstract representation that hides the low-level Jvm class data structure.static <T extends ProcessingFlags>
ClassViewModelrender(Clazz clazz, java.lang.Class<T> processingFlagsHolder)
RendersClazz
object into an abstract representation that hides the low-level Jvm class data structure; additional processing flags declared in a subclass ofProcessingFlags
will also be rendered.static ConstantViewModel[]
renderConstantPool(Clazz model)
A utility method for rendering each constant pool entry into a higher-level representation.static FieldViewModel[]
renderFields(Clazz model)
A utility method for rendering eachField
into a higher-level representation.static ClassViewModel[]
renderInterfaces(Clazz model)
A utility method for recursively rendering interfaces of an implementingClazz
.static MethodViewModel[]
renderMethods(Clazz model)
A utility method for rendering eachMethod
into a higher-level representation.static java.lang.String
renderPreview(Clazz model)
A utility method that renders aClazz
object into a string containing class name, type, accessibility.static ClassViewModel
renderSuperClass(Clazz model)
A utility method for recursively renderingClazz
objects in the hierarchy.-
Methods inherited from class proguard.classfile.util.renderer.ProcessableViewModel
addExtraProcessingFlags, renderProcessingFlags
-
-
-
-
Method Detail
-
render
public static ClassViewModel render(Clazz clazz)
RendersClazz
object into an abstract representation that hides the low-level Jvm class data structure. The processing flags rendering are limited to those declared inProcessingFlags
.- Parameters:
clazz
- TheClazz
object to be rendered.- Returns:
- A high-level representation of
Clazz
(i.e.,ClassViewModel
object).
-
render
public static <T extends ProcessingFlags> ClassViewModel render(Clazz clazz, java.lang.Class<T> processingFlagsHolder)
RendersClazz
object into an abstract representation that hides the low-level Jvm class data structure; additional processing flags declared in a subclass ofProcessingFlags
will also be rendered.- Parameters:
clazz
- TheClazz
object to be rendered.processingFlagsHolder
- A subclass ofProcessingFlags
that holds additional processing flags.- Returns:
- A high-level representation of
Clazz
(i.e.,ClassViewModel
object).
-
renderPreview
public static java.lang.String renderPreview(Clazz model)
A utility method that renders aClazz
object into a string containing class name, type, accessibility. (e.g., "public static class Foo").- Parameters:
model
-Clazz
object to be rendered.- Returns:
- A string previewing the class signature.
-
renderSuperClass
public static ClassViewModel renderSuperClass(Clazz model)
A utility method for recursively renderingClazz
objects in the hierarchy.
-
renderInterfaces
public static ClassViewModel[] renderInterfaces(Clazz model)
A utility method for recursively rendering interfaces of an implementingClazz
.- Parameters:
model
- AClazz
object whose interfaces need to be rendered.- Returns:
- An array of high-level representation of the implemented interfaces.
-
renderConstantPool
public static ConstantViewModel[] renderConstantPool(Clazz model)
A utility method for rendering each constant pool entry into a higher-level representation. seeConstantViewModel
.- Parameters:
model
- AClazz
object whose constant pool needs to be rendered.- Returns:
- An array of high-level representation of the constant pool entries.
-
renderFields
public static FieldViewModel[] renderFields(Clazz model)
A utility method for rendering eachField
into a higher-level representation. seeFieldViewModel
.- Parameters:
model
- AClazz
object whose fields need to be rendered.- Returns:
- An array of high-level representation of the class' fields.
-
renderMethods
public static MethodViewModel[] renderMethods(Clazz model)
A utility method for rendering eachMethod
into a higher-level representation. seeMethodViewModel
.- Parameters:
model
- AClazz
object whose methods need to be rendered.- Returns:
- An array of high-level representation of the class' methods.
-
-