Interface Maker
- 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.void
addAttribute
(String name, Object value) Add a generic JVM attribute which optionally references a constant value.Returns theClassMaker
for this item, which can also be used as a type specification.final_()
Switch this item to be final.name()
Returns the name of the item being made.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
-
name
String name()Returns the name of the item being made. -
public_
-
private_
-
protected_
-
static_
-
final_
-
synthetic
-
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 theClassMaker
for 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.
-