Interface Maker

All Known Subinterfaces:
ClassMaker, FieldMaker, MethodMaker

public interface Maker
Base interface for making classes, methods, and fields.
  • Method Details

    • name

      String name()
      Returns the name of the item being made.
    • public_

      Maker public_()
      Switch this item to be public.
      Returns:
      this
    • private_

      Maker private_()
      Switch this item to be private.
      Returns:
      this
    • protected_

      Maker protected_()
      Switch this item to be protected.
      Returns:
      this
    • static_

      Maker static_()
      Switch this item to be static.
      Returns:
      this
    • final_

      Maker final_()
      Switch this item to be final.
      Returns:
      this
    • synthetic

      Maker synthetic()
      Indicate that this item is synthetic.
      Returns:
      this
    • signature

      Maker signature(Object... components)
      Define a signature for this member, which is a string for supporting generic types. The components can be strings or types (class, ClassMaker, etc.), which are concatenated into a single string. Consult the JVM specification for the signature syntax.
      Returns:
      this
      Throws:
      IllegalArgumentException - if given an unsupported component
      See Also:
    • classMaker

      ClassMaker classMaker()
      Returns the ClassMaker for this item, which can also be used as a type specification.
    • addAnnotation

      AnnotationMaker addAnnotation(Object annotationType, boolean visible)
      Add an annotation to this item.
      Parameters:
      annotationType - name or class which refers to an annotation interface
      visible - true if annotation is visible at runtime
      Throws:
      IllegalArgumentException - if the annotation type is unsupported
      See Also:
    • addAttribute

      void addAttribute(String name, Object value)
      Add a generic JVM attribute which optionally references a constant value. This is an advanced feature for defining attributes which aren't directly supported by the core maker API. Allowed value types are: int, float, long, double, String, Class, raw byte[], or an array of values. Arrays aren't encoded with any length prefix, but a raw byte[] as the first element can be interpreted as such.
    • mangle

      static String mangle(String name)
      Mangles a name as described by symbolic freedom in the VM. If the name doesn't need to be mangled, then the original name is returned. Otherwise, the returned mangled name starts with a backslash character.
      See Also:
    • demangle

      static String demangle(String mangled)
      Demangles a name. If the given string doesn't start with a backslash, then the original string is returned. If the string starts with \= (backslash, equals), then that portion is always trimmed off, even if the rest of the string isn't mangled.
      See Also: