public class ClassViewModel extends ProcessableViewModel
Clazz
objects into a more human-readable format. It can be
used as a Java type renderer in Intellij-based IDE to support debugging.processingFlags, processingInfo
Modifier and Type | Method and Description |
---|---|
static ClassViewModel |
render(Clazz clazz)
Renders
Clazz object into an abstract representation that hides the low-level Jvm class
data structure. |
static <T extends ProcessingFlags> |
render(Clazz clazz,
java.lang.Class<T> processingFlagsHolder)
Renders
Clazz object into an abstract representation that hides the low-level Jvm class
data structure; additional processing flags declared in a subclass of ProcessingFlags
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 each
Field into a higher-level representation. |
static ClassViewModel[] |
renderInterfaces(Clazz model)
A utility method for recursively rendering interfaces of an implementing
Clazz . |
static MethodViewModel[] |
renderMethods(Clazz model)
A utility method for rendering each
Method into a higher-level representation. |
static java.lang.String |
renderPreview(Clazz model)
A utility method that renders a
Clazz object into a string containing class name, type,
accessibility. |
static ClassViewModel |
renderSuperClass(Clazz model)
A utility method for recursively rendering
Clazz objects in the hierarchy. |
addExtraProcessingFlags, renderProcessingFlags
public static ClassViewModel render(Clazz clazz)
Clazz
object into an abstract representation that hides the low-level Jvm class
data structure. The processing flags rendering are limited to those declared in ProcessingFlags
.clazz
- The Clazz
object to be rendered.Clazz
(i.e., ClassViewModel
object).public static <T extends ProcessingFlags> ClassViewModel render(Clazz clazz, java.lang.Class<T> processingFlagsHolder)
Clazz
object into an abstract representation that hides the low-level Jvm class
data structure; additional processing flags declared in a subclass of ProcessingFlags
will also be rendered.clazz
- The Clazz
object to be rendered.processingFlagsHolder
- A subclass of ProcessingFlags
that holds additional
processing flags.Clazz
(i.e., ClassViewModel
object).public static java.lang.String renderPreview(Clazz model)
Clazz
object into a string containing class name, type,
accessibility. (e.g., "public static class Foo").model
- Clazz
object to be rendered.public static ClassViewModel renderSuperClass(Clazz model)
Clazz
objects in the hierarchy.public static ClassViewModel[] renderInterfaces(Clazz model)
Clazz
.model
- A Clazz
object whose interfaces need to be rendered.public static ConstantViewModel[] renderConstantPool(Clazz model)
ConstantViewModel
.model
- A Clazz
object whose constant pool needs to be rendered.public static FieldViewModel[] renderFields(Clazz model)
Field
into a higher-level representation. see
FieldViewModel
.model
- A Clazz
object whose fields need to be rendered.public static MethodViewModel[] renderMethods(Clazz model)
Method
into a higher-level representation. see
MethodViewModel
.model
- A Clazz
object whose methods need to be rendered.