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, 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.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 insteadgetInitializationExpression
(CodegenClassScope classScope) Returns the initialization expressionvoid
setBuilderConsumer
(Consumer<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
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
Returns the builder consumer, a consumer that the strategy invokes when it is ready to build the code- Returns:
- builder consumer
-
setBuilderConsumer
Sets the builder consumer, a consumer that the strategy invokes when it is ready to build the code- Parameters:
builderConsumer
- builder consumer
-
getInitializationExpression
Description copied from interface:InjectionStrategy
Returns the initialization expression- Specified by:
getInitializationExpression
in interfaceInjectionStrategy
- Parameters:
classScope
- the class scope- Returns:
- class scope
-