Class ConstantViewModel


  • public class ConstantViewModel
    extends ProcessableViewModel
    This utility class renders Constant objects into a more human-readable format. It can be used as a Java type renderer in Intellij-based IDE to support debugging.
    • Constructor Detail

      • ConstantViewModel

        public ConstantViewModel​(Clazz clazz,
                                 Constant constant)
        A constructor to keep track of the Constant object to be rendered and its associated Clazz
        Parameters:
        clazz - The Clazz that the Constant entry belongs to.
        constant - The Constant object to be rendered.
    • Method Detail

      • renderPreview

        public java.lang.String renderPreview()
        A utility method that renders a Constant entry into a preview string, e.g., String(18) -> "Foo".
        Returns:
        A string previewing the constant pool entry.