Class InjectionStrategyClassNewInstance
java.lang.Object
com.espertech.esper.common.client.hook.forgeinject.InjectionStrategyClassNewInstance
- All Implemented Interfaces:
InjectionStrategy
Provides the compiler with code that allocates and initializes an instance of some class
by using "new" and by using setters.
-
Constructor Summary
ConstructorDescriptionThe class to be instantiated.The class to be instantiated.InjectionStrategyClassNewInstance
(String fullyQualifiedClassName) The class name of the class to be instantiated. -
Method Summary
Modifier and TypeMethodDescriptionaddConstant
(String name, Object value) Add a constant to be provided by invoking the setter method of the class, at deployment timeaddExpression
(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 anExprEvaluator
instance.Consumer<com.espertech.esper.common.internal.context.aifactory.core.SAIFFInitializeBuilder>
Returns the builder consumer, a consumer that the strategy invokes when it is ready to build the codegetClazz()
Returns the class, or null if providing a class name insteadReturns the class name, or null if providing a class insteadcom.espertech.esper.common.internal.bytecodemodel.model.expression.CodegenExpression
getInitializationExpression
(com.espertech.esper.common.internal.bytecodemodel.base.CodegenClassScope classScope) Returns the initialization expressionvoid
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
-
Constructor Details
-
InjectionStrategyClassNewInstance
The class to be instantiated.- Parameters:
clazz
- class
-
InjectionStrategyClassNewInstance
The class to be instantiated.- Parameters:
clazz
- class
-
InjectionStrategyClassNewInstance
The class name of the class to be instantiated.- Parameters:
fullyQualifiedClassName
- class name
-
-
Method Details
-
getClazz
Returns the class, or null if providing a class name instead- Returns:
- class
-
getFullyQualifiedClassName
Returns the class name, or null if providing a class instead- Returns:
- class name
-
addConstant
Add a constant to be provided by invoking the setter method of the class, at deployment time- Parameters:
name
- property namevalue
- 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 anExprEvaluator
instance.- Parameters:
name
- property namevalue
- 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 interfaceInjectionStrategy
- Parameters:
classScope
- the class scope- Returns:
- class scope
-