- All Known Subinterfaces:
ClassMaker,FieldMaker,MethodMaker
public interface Maker
Base interface for making classes, methods, and fields.
-
Method Summary
Modifier and TypeMethodDescriptionaddAnnotation(Object annotationType, boolean visible) Add an annotation to this item.voidaddAttribute(String name, Object value) Add a generic JVM attribute which optionally references a constant value.Returns theClassMakerfor this item, which can also be used as a type specification.final_()Switch this item to be final.private_()Switch this item to be private.Switch this item to be protected.public_()Switch this item to be public.Define a signature for this member, which is a string for supporting generic types.static_()Switch this item to be static.Indicate that this item is synthetic.
-
Method Details
-
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
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
-
classMaker
ClassMaker classMaker()Returns theClassMakerfor this item, which can also be used as a type specification. -
addAnnotation
Add an annotation to this item.- Parameters:
annotationType- name or class which refers to an annotation interfacevisible- true if annotation is visible at runtime- Throws:
IllegalArgumentException- if the annotation type is unsupported
-
addAttribute
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.
-