Class InjectionStrategyClassNewInstance

java.lang.Object
com.espertech.esper.common.client.hook.forgeinject.InjectionStrategyClassNewInstance
All Implemented Interfaces:
InjectionStrategy

public class InjectionStrategyClassNewInstance extends Object implements InjectionStrategy
Provides the compiler with code that allocates and initializes an instance of some class by using "new" and by using setters.
  • Constructor Details

    • InjectionStrategyClassNewInstance

      public InjectionStrategyClassNewInstance(EPTypeClass clazz)
      The class to be instantiated.
      Parameters:
      clazz - class
    • InjectionStrategyClassNewInstance

      public InjectionStrategyClassNewInstance(Class clazz)
      The class to be instantiated.
      Parameters:
      clazz - class
    • InjectionStrategyClassNewInstance

      public InjectionStrategyClassNewInstance(String fullyQualifiedClassName)
      The class name of the class to be instantiated.
      Parameters:
      fullyQualifiedClassName - class name
  • Method Details

    • getClazz

      public EPTypeClass getClazz()
      Returns the class, or null if providing a class name instead
      Returns:
      class
    • getFullyQualifiedClassName

      public String getFullyQualifiedClassName()
      Returns the class name, or null if providing a class instead
      Returns:
      class name
    • addConstant

      public InjectionStrategyClassNewInstance addConstant(String name, Object value)
      Add a constant to be provided by invoking the setter method of the class, at deployment time
      Parameters:
      name - property name
      value - constant value
      Returns:
      itself
    • addExpression

      public InjectionStrategyClassNewInstance addExpression(String name, com.espertech.esper.common.internal.epl.expression.core.ExprNode value)
      Add an expression to be provided by invoking the setter method of the class, at deployment time, the setter should accept an ExprEvaluator instance.
      Parameters:
      name - property name
      value - expression
      Returns:
      itself
    • getBuilderConsumer

      public Consumer<com.espertech.esper.common.internal.context.aifactory.core.SAIFFInitializeBuilder> getBuilderConsumer()
      Returns the builder consumer, a consumer that the strategy invokes when it is ready to build the code
      Returns:
      builder consumer
    • setBuilderConsumer

      public void setBuilderConsumer(Consumer<com.espertech.esper.common.internal.context.aifactory.core.SAIFFInitializeBuilder> builderConsumer)
      Sets the builder consumer, a consumer that the strategy invokes when it is ready to build the code
      Parameters:
      builderConsumer - builder consumer
    • getInitializationExpression

      public com.espertech.esper.common.internal.bytecodemodel.model.expression.CodegenExpression getInitializationExpression(com.espertech.esper.common.internal.bytecodemodel.base.CodegenClassScope classScope)
      Description copied from interface: InjectionStrategy
      Returns the initialization expression
      Specified by:
      getInitializationExpression in interface InjectionStrategy
      Parameters:
      classScope - the class scope
      Returns:
      class scope