Class ConstantViewModel

java.lang.Object
proguard.classfile.util.renderer.ProcessableViewModel
proguard.classfile.util.renderer.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 Details

    • 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 Details

    • renderPreview

      public 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.