Class Bootstraps


  • public final class Bootstraps
    extends Object
    Single source of truth for resolving invokedynamic/condy bootstraps from a ClassFile's BootstrapMethods attribute.
    • Method Detail

      • resolve

        public static Bootstraps.BootstrapRef resolve​(ClassFile classFile,
                                                      int attrIndex)
        Resolves the bootstrap at the given BootstrapMethods-attribute index.
        Parameters:
        classFile - the owning class file
        attrIndex - the bootstrap-method attribute index (from an indy/condy CP item)
        Returns:
        the resolved reference, or null when the attribute or index is invalid
      • constantValue

        public static String constantValue​(ConstPool constPool,
                                           int cpIndex)
        Renders a loadable constant at the given index to a readable string, mirroring disassembly's constant formatting.
        Parameters:
        constPool - the constant pool
        cpIndex - the constant-pool index
        Returns:
        a readable representation of the constant
      • readableRecipe

        public static String readableRecipe​(String raw)
        Renders a StringConcatFactory recipe to its readable {arg}/{const} form.
        Parameters:
        raw - the raw recipe string
        Returns:
        the readable recipe, or null when raw is null