Package io.automatiko.engine.codegen.di
Class CDIDependencyInjectionAnnotator
- java.lang.Object
-
- io.automatiko.engine.codegen.di.CDIDependencyInjectionAnnotator
-
- All Implemented Interfaces:
DependencyInjectionAnnotator
public class CDIDependencyInjectionAnnotator extends java.lang.Object implements DependencyInjectionAnnotator
-
-
Constructor Summary
Constructors Constructor Description CDIDependencyInjectionAnnotator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringapplicationComponentType()Returns type that allows to mark instance as application component e.g.java.lang.StringemitterType(java.lang.String dataType)Returns type to be used as message emittercom.github.javaparser.ast.expr.ExpressiongetMultiInstance(java.lang.String fieldName)Creates an expression that returns a list of instances for given multi instance fieldjava.lang.StringmultiInstanceInjectionType()Returns type that allows to inject multiple instances of the same typejava.lang.StringobjectMapperInjectorSource(java.lang.String packageName)com.github.javaparser.ast.expr.ExpressionoptionalInstanceExists(java.lang.String fieldName)Creates an expression that represents optional instance for given fieldjava.lang.StringoptionalInstanceInjectionType()Returns type that allows to inject optional instances of the same type<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithApplicationComponent(T node)Annotates given node with application level annotations e.g.<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithBlocking(T node)Annotates given node with blocking annotation<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithCloudEventMapping(T node, java.lang.String trigger, java.lang.String filter)Annotates given node with cloud event mapping for function flow<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithConfig(T node, java.lang.String configKey)Annotates given node with configuration parameter injection<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithConfigInjection(T node, java.lang.String configKey)Annotates given node with configuration parameter injection<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithConfigInjection(T node, java.lang.String configKey, java.lang.String defaultValue)Annotates given node with configuration parameter injection with default value<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithFunction(T node)Annotates given node with function<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithIncomingMessage(T node, java.lang.String channel)Annotates given node with incoming message that it should consume fromcom.github.javaparser.ast.body.MethodDeclarationwithInitMethod(com.github.javaparser.ast.expr.Expression... expression)Create initialization method with given expression as body<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithInjection(T node)Annotates given node with injection annotations e.g.com.github.javaparser.ast.expr.MethodCallExprwithMessageProducer(com.github.javaparser.ast.expr.MethodCallExpr produceMethod, java.lang.String channel, com.github.javaparser.ast.expr.Expression event)Annotates and enhances method used to produce messages<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithNamed(T node, java.lang.String name)Annotates given node with name annotation e.g.<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithNamedApplicationComponent(T node, java.lang.String name)Annotates given node with application level annotations e.g.<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithNamedInjection(T node, java.lang.String name)Annotates given node with injection annotations e.g.<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithNamedSingletonComponent(T node, java.lang.String name)Annotates given node with singleton level annotations e.g.<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithOptionalInjection(T node)Annotates given node with optional injection annotations e.g.<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithOutgoingMessage(T node, java.lang.String channel)Annotates given node with outgoing message that it should send to<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithRestClientInjection(T node)Annotates given node with rest client injection<T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
TwithSingletonComponent(T node)Annotates given node with singleton level annotations e.g.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.automatiko.engine.codegen.di.DependencyInjectionAnnotator
getOptionalInstance, withSecurityRoles
-
-
-
-
Method Detail
-
withNamed
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withNamed(T node, java.lang.String name)Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with name annotation e.g. Named, Qualifier- Specified by:
withNamedin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotated
-
withApplicationComponent
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withApplicationComponent(T node)
Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with application level annotations e.g. ApplicationScoped, Component- Specified by:
withApplicationComponentin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotated
-
withNamedApplicationComponent
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withNamedApplicationComponent(T node, java.lang.String name)Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with application level annotations e.g. ApplicationScoped, Component additionally adding name to it- Specified by:
withNamedApplicationComponentin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotatedname- name to be assigned to given node
-
withSingletonComponent
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withSingletonComponent(T node)
Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with singleton level annotations e.g. Singleton, Component- Specified by:
withSingletonComponentin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotated
-
withNamedSingletonComponent
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withNamedSingletonComponent(T node, java.lang.String name)Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with singleton level annotations e.g. Singleton, Component additionally adding name to it- Specified by:
withNamedSingletonComponentin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotatedname- name to be assigned to given node
-
withInjection
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withInjection(T node)
Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with injection annotations e.g. Inject, Autowire- Specified by:
withInjectionin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotated
-
withNamedInjection
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withNamedInjection(T node, java.lang.String name)Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with injection annotations e.g. Inject, Autowire additionally adding name to it- Specified by:
withNamedInjectionin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotatedname- name to be assigned to given node
-
withOptionalInjection
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withOptionalInjection(T node)
Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with optional injection annotations e.g. Inject, Autowire- Specified by:
withOptionalInjectionin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotated
-
withIncomingMessage
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withIncomingMessage(T node, java.lang.String channel)Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with incoming message that it should consume from- Specified by:
withIncomingMessagein interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotatedchannel- name of the channel messages should be consumer from
-
withOutgoingMessage
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withOutgoingMessage(T node, java.lang.String channel)Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with outgoing message that it should send to- Specified by:
withOutgoingMessagein interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotatedchannel- name of the channel messages should be send to
-
withMessageProducer
public com.github.javaparser.ast.expr.MethodCallExpr withMessageProducer(com.github.javaparser.ast.expr.MethodCallExpr produceMethod, java.lang.String channel, com.github.javaparser.ast.expr.Expression event)Description copied from interface:DependencyInjectionAnnotatorAnnotates and enhances method used to produce messages- Specified by:
withMessageProducerin interfaceDependencyInjectionAnnotator- Parameters:
produceMethod- method to be annotatedchannel- channel on which messages should be producedevent- actual data to be send
-
withInitMethod
public com.github.javaparser.ast.body.MethodDeclaration withInitMethod(com.github.javaparser.ast.expr.Expression... expression)
Description copied from interface:DependencyInjectionAnnotatorCreate initialization method with given expression as body- Specified by:
withInitMethodin interfaceDependencyInjectionAnnotator- Parameters:
expression- body of the init method- Returns:
- complete initialization method declaration
-
optionalInstanceInjectionType
public java.lang.String optionalInstanceInjectionType()
Description copied from interface:DependencyInjectionAnnotatorReturns type that allows to inject optional instances of the same type- Specified by:
optionalInstanceInjectionTypein interfaceDependencyInjectionAnnotator- Returns:
- fully qualified class name
-
optionalInstanceExists
public com.github.javaparser.ast.expr.Expression optionalInstanceExists(java.lang.String fieldName)
Description copied from interface:DependencyInjectionAnnotatorCreates an expression that represents optional instance for given field- Specified by:
optionalInstanceExistsin interfaceDependencyInjectionAnnotator- Parameters:
fieldName- name of the field that should be considered optional- Returns:
- complete expression for optional instance
-
multiInstanceInjectionType
public java.lang.String multiInstanceInjectionType()
Description copied from interface:DependencyInjectionAnnotatorReturns type that allows to inject multiple instances of the same type- Specified by:
multiInstanceInjectionTypein interfaceDependencyInjectionAnnotator- Returns:
- fully qualified class name
-
getMultiInstance
public com.github.javaparser.ast.expr.Expression getMultiInstance(java.lang.String fieldName)
Description copied from interface:DependencyInjectionAnnotatorCreates an expression that returns a list of instances for given multi instance field- Specified by:
getMultiInstancein interfaceDependencyInjectionAnnotator- Parameters:
fieldName- name of the multi field that should be accessed- Returns:
- complete expression for multi instance
-
applicationComponentType
public java.lang.String applicationComponentType()
Description copied from interface:DependencyInjectionAnnotatorReturns type that allows to mark instance as application component e.g. ApplicationScoped, Component- Specified by:
applicationComponentTypein interfaceDependencyInjectionAnnotator- Returns:
- fully qualified class name
-
emitterType
public java.lang.String emitterType(java.lang.String dataType)
Description copied from interface:DependencyInjectionAnnotatorReturns type to be used as message emitter- Specified by:
emitterTypein interfaceDependencyInjectionAnnotator- Parameters:
dataType- type of the data produces by the emitter- Returns:
- fully qualified class name
-
withConfig
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withConfig(T node, java.lang.String configKey)Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with configuration parameter injection- Specified by:
withConfigin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotatedconfigKey- name of the configuration property to be injected
-
withConfigInjection
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withConfigInjection(T node, java.lang.String configKey)Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with configuration parameter injection- Specified by:
withConfigInjectionin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotatedconfigKey- name of the configuration property to be injected
-
withConfigInjection
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withConfigInjection(T node, java.lang.String configKey, java.lang.String defaultValue)Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with configuration parameter injection with default value- Specified by:
withConfigInjectionin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotatedconfigKey- name of the configuration property to be injecteddefaultValue- value to be used in case there is no config parameter defined
-
objectMapperInjectorSource
public java.lang.String objectMapperInjectorSource(java.lang.String packageName)
- Specified by:
objectMapperInjectorSourcein interfaceDependencyInjectionAnnotator
-
withRestClientInjection
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withRestClientInjection(T node)
Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with rest client injection- Specified by:
withRestClientInjectionin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotated
-
withFunction
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withFunction(T node)
Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with function- Specified by:
withFunctionin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotated
-
withCloudEventMapping
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withCloudEventMapping(T node, java.lang.String trigger, java.lang.String filter)Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with cloud event mapping for function flow- Specified by:
withCloudEventMappingin interfaceDependencyInjectionAnnotator- Parameters:
node- node to be annotatedtrigger- the trigger mapping for cloud event- Returns:
- returns annotated node
-
withBlocking
public <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withBlocking(T node)
Description copied from interface:DependencyInjectionAnnotatorAnnotates given node with blocking annotation- Specified by:
withBlockingin interfaceDependencyInjectionAnnotator- Returns:
- returns annotated node
-
-