Interface Bytecode.ClassBuilder<T>
- Type Parameters:
T- the type of base class the class shall be created for
- All Superinterfaces:
de.iip_ecosphere.platform.support.Builder<Class<? extends T>>
- Enclosing class:
Bytecode
public static interface Bytecode.ClassBuilder<T>
extends de.iip_ecosphere.platform.support.Builder<Class<? extends T>>
Builds a dynamic class.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceSub-builder for type annotations.static interfaceSub-builder for field annotations.static interfaceSub-builder for annotations.static interfaceSub-builder for type annotations. -
Method Summary
Modifier and TypeMethodDescriptionannotate(Class<? extends Annotation> type) Annotates the class with the given annotation.build()Builds and loads the class instance.defineProperty(String name, Class<?> type) Defines a Java bean property, i.e., a private field as well as corresponding getter and setter.definePublicField(String name, Class<?> type) Defines a public Java field.Defines an interface class to be built shall implement.
-
Method Details
-
implement
Defines an interface class to be built shall implement.- Parameters:
cls- the interface to implement- Returns:
- this for chaining
-
defineProperty
Defines a Java bean property, i.e., a private field as well as corresponding getter and setter.- Parameters:
name- the name of the propertytype- the type of the property- Returns:
- this for chaining
-
definePublicField
Defines a public Java field.- Parameters:
name- the name of the fieldtype- the type of the field- Returns:
- the field builder
-
annotate
Annotates the class with the given annotation.- Parameters:
type- the annotation type- Returns:
- the annotation builder for further properties
-
build
Builds and loads the class instance.- Specified by:
buildin interfacede.iip_ecosphere.platform.support.Builder<T>- Throws:
IllegalStateException- if the specification of the class is illegal
-