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 rendersClazzobjects 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 ClassViewModelrender(Clazz clazz)RendersClazzobject 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)RendersClazzobject into an abstract representation that hides the low-level Jvm class data structure; additional processing flags declared in a subclass ofProcessingFlagswill 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 eachFieldinto 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 eachMethodinto a higher-level representation.static java.lang.StringrenderPreview(Clazz model)A utility method that renders aClazzobject into a string containing class name, type, accessibility.static ClassViewModelrenderSuperClass(Clazz model)A utility method for recursively renderingClazzobjects in the hierarchy.-
Methods inherited from class proguard.classfile.util.renderer.ProcessableViewModel
addExtraProcessingFlags, renderProcessingFlags
-
-
-
-
Method Detail
-
render
public static ClassViewModel render(Clazz clazz)
RendersClazzobject 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- TheClazzobject to be rendered.- Returns:
- A high-level representation of
Clazz(i.e.,ClassViewModelobject).
-
render
public static <T extends ProcessingFlags> ClassViewModel render(Clazz clazz, java.lang.Class<T> processingFlagsHolder)
RendersClazzobject into an abstract representation that hides the low-level Jvm class data structure; additional processing flags declared in a subclass ofProcessingFlagswill also be rendered.- Parameters:
clazz- TheClazzobject to be rendered.processingFlagsHolder- A subclass ofProcessingFlagsthat holds additional processing flags.- Returns:
- A high-level representation of
Clazz(i.e.,ClassViewModelobject).
-
renderPreview
public static java.lang.String renderPreview(Clazz model)
A utility method that renders aClazzobject into a string containing class name, type, accessibility. (e.g., "public static class Foo").- Parameters:
model-Clazzobject to be rendered.- Returns:
- A string previewing the class signature.
-
renderSuperClass
public static ClassViewModel renderSuperClass(Clazz model)
A utility method for recursively renderingClazzobjects in the hierarchy.
-
renderInterfaces
public static ClassViewModel[] renderInterfaces(Clazz model)
A utility method for recursively rendering interfaces of an implementingClazz.- Parameters:
model- AClazzobject 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- AClazzobject 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 eachFieldinto a higher-level representation. seeFieldViewModel.- Parameters:
model- AClazzobject 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 eachMethodinto a higher-level representation. seeMethodViewModel.- Parameters:
model- AClazzobject whose methods need to be rendered.- Returns:
- An array of high-level representation of the class' methods.
-
-