public class InjectionStrategyClassNewInstance extends Object implements InjectionStrategy
Constructor and Description |
---|
InjectionStrategyClassNewInstance(Class clazz)
The class to be instantiated.
|
InjectionStrategyClassNewInstance(String fullyQualifiedClassName)
The class name of the class to be instantiated.
|
Modifier and Type | Method and Description |
---|---|
InjectionStrategyClassNewInstance |
addConstant(String name,
Object value)
Add a constant to be provided by invoking the setter method of the class, at deployment time
|
InjectionStrategyClassNewInstance |
addExpression(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 an
ExprEvaluator instance. |
Consumer<SAIFFInitializeBuilder> |
getBuilderConsumer()
Returns the builder consumer, a consumer that the strategy invokes when it is ready to build the code
|
Class |
getClazz()
Returns the class, or null if providing a class name instead
|
String |
getFullyQualifiedClassName()
Returns the class name, or null if providing a class instead
|
CodegenExpression |
getInitializationExpression(CodegenClassScope classScope)
Returns the initialization expression
|
void |
setBuilderConsumer(Consumer<SAIFFInitializeBuilder> builderConsumer)
Sets the builder consumer, a consumer that the strategy invokes when it is ready to build the code
|
public InjectionStrategyClassNewInstance(Class clazz)
clazz
- classpublic InjectionStrategyClassNewInstance(String fullyQualifiedClassName)
fullyQualifiedClassName
- class namepublic Class getClazz()
public String getFullyQualifiedClassName()
public InjectionStrategyClassNewInstance addConstant(String name, Object value)
name
- property namevalue
- constant valuepublic InjectionStrategyClassNewInstance addExpression(String name, ExprNode value)
ExprEvaluator
instance.name
- property namevalue
- expressionpublic Consumer<SAIFFInitializeBuilder> getBuilderConsumer()
public void setBuilderConsumer(Consumer<SAIFFInitializeBuilder> builderConsumer)
builderConsumer
- builder consumerpublic CodegenExpression getInitializationExpression(CodegenClassScope classScope)
InjectionStrategy
getInitializationExpression
in interface InjectionStrategy
classScope
- the class scopeCopyright © 2005–2018. All rights reserved.