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
  • Method Details

    • implement

      Bytecode.ClassBuilder<T> implement(Class<?> cls)
      Defines an interface class to be built shall implement.
      Parameters:
      cls - the interface to implement
      Returns:
      this for chaining
    • defineProperty

      Bytecode.ClassBuilder.FieldBuilder<T> defineProperty(String name, Class<?> type)
      Defines a Java bean property, i.e., a private field as well as corresponding getter and setter.
      Parameters:
      name - the name of the property
      type - the type of the property
      Returns:
      this for chaining
    • definePublicField

      Bytecode.ClassBuilder.FieldBuilder<T> definePublicField(String name, Class<?> type)
      Defines a public Java field.
      Parameters:
      name - the name of the field
      type - 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

      Class<? extends T> build() throws IllegalStateException
      Builds and loads the class instance.
      Specified by:
      build in interface de.iip_ecosphere.platform.support.Builder<T>
      Throws:
      IllegalStateException - if the specification of the class is illegal