Interface DependencyInjectionAnnotator

  • All Known Implementing Classes:
    CDIDependencyInjectionAnnotator

    public interface DependencyInjectionAnnotator
    Generic abstraction for dependency injection annotations that allow to use different frameworks based needs. Currently in scope
    • CDI
    • Spring
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.lang.String applicationComponentType()
      Returns type that allows to mark instance as application component e.g.
      java.lang.String emitterType​(java.lang.String dataType)
      Returns type to be used as message emitter
      com.github.javaparser.ast.expr.Expression getMultiInstance​(java.lang.String fieldName)
      Creates an expression that returns a list of instances for given multi instance field
      default com.github.javaparser.ast.expr.Expression getOptionalInstance​(java.lang.String fieldName)
      Creates an expression that returns instance for given optional field
      java.lang.String multiInstanceInjectionType()
      Returns type that allows to inject multiple instances of the same type
      java.lang.String objectMapperInjectorSource​(java.lang.String packageName)  
      com.github.javaparser.ast.expr.Expression optionalInstanceExists​(java.lang.String fieldName)
      Creates an expression that represents optional instance for given field
      java.lang.String optionalInstanceInjectionType()
      Returns type that allows to inject optional instances of the same type
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withApplicationComponent​(T node)
      Annotates given node with application level annotations e.g.
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withBlocking​(T template)
      Annotates given node with blocking annotation
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withCloudEventMapping​(T node, java.lang.String string, java.lang.String filter)
      Annotates given node with cloud event mapping for function flow
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withConfig​(T node, java.lang.String configKey)
      Annotates given node with configuration parameter injection
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withConfigInjection​(T node, java.lang.String configKey)
      Annotates given node with configuration parameter injection
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withConfigInjection​(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<?>>
      T
      withFunction​(T node)
      Annotates given node with function
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withIncomingMessage​(T node, java.lang.String channel)
      Annotates given node with incoming message that it should consume from
      com.github.javaparser.ast.body.MethodDeclaration withInitMethod​(com.github.javaparser.ast.expr.Expression... expression)
      Create initialization method with given expression as body
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withInjection​(T node)
      Annotates given node with injection annotations e.g.
      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)
      Annotates and enhances method used to produce messages
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withNamed​(T node, java.lang.String name)
      Annotates given node with name annotation e.g.
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withNamedApplicationComponent​(T node, java.lang.String name)
      Annotates given node with application level annotations e.g.
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withNamedInjection​(T node, java.lang.String name)
      Annotates given node with injection annotations e.g.
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withNamedSingletonComponent​(T node, java.lang.String name)
      Annotates given node with singleton level annotations e.g.
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withOptionalInjection​(T node)
      Annotates given node with optional injection annotations e.g.
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withOutgoingMessage​(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<?>>
      T
      withRestClientInjection​(T node)
      Annotates given node with rest client injection
      default <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withSecurityRoles​(T node, java.lang.String[] roles)
      Annotates given node with set of roles to enforce security
      <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>>
      T
      withSingletonComponent​(T node)
      Annotates given node with singleton level annotations e.g.
    • Method Detail

      • withNamed

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withNamed​(T node,
                                                                                           java.lang.String name)
        Annotates given node with name annotation e.g. Named, Qualifier
        Parameters:
        node - node to be annotated
      • withApplicationComponent

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withApplicationComponent​(T node)
        Annotates given node with application level annotations e.g. ApplicationScoped, Component
        Parameters:
        node - node to be annotated
      • withNamedApplicationComponent

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withNamedApplicationComponent​(T node,
                                                                                                               java.lang.String name)
        Annotates given node with application level annotations e.g. ApplicationScoped, Component additionally adding name to it
        Parameters:
        node - node to be annotated
        name - name to be assigned to given node
      • withSingletonComponent

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withSingletonComponent​(T node)
        Annotates given node with singleton level annotations e.g. Singleton, Component
        Parameters:
        node - node to be annotated
      • withNamedSingletonComponent

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withNamedSingletonComponent​(T node,
                                                                                                             java.lang.String name)
        Annotates given node with singleton level annotations e.g. Singleton, Component additionally adding name to it
        Parameters:
        node - node to be annotated
        name - name to be assigned to given node
      • withInjection

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withInjection​(T node)
        Annotates given node with injection annotations e.g. Inject, Autowire
        Parameters:
        node - node to be annotated
      • withNamedInjection

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withNamedInjection​(T node,
                                                                                                    java.lang.String name)
        Annotates given node with injection annotations e.g. Inject, Autowire additionally adding name to it
        Parameters:
        node - node to be annotated
        name - name to be assigned to given node
      • withOptionalInjection

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withOptionalInjection​(T node)
        Annotates given node with optional injection annotations e.g. Inject, Autowire
        Parameters:
        node - node to be annotated
      • withIncomingMessage

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withIncomingMessage​(T node,
                                                                                                     java.lang.String channel)
        Annotates given node with incoming message that it should consume from
        Parameters:
        node - node to be annotated
        channel - name of the channel messages should be consumer from
      • withOutgoingMessage

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withOutgoingMessage​(T node,
                                                                                                     java.lang.String channel)
        Annotates given node with outgoing message that it should send to
        Parameters:
        node - node to be annotated
        channel - name of the channel messages should be send to
      • withConfig

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withConfig​(T node,
                                                                                            java.lang.String configKey)
        Annotates given node with configuration parameter injection
        Parameters:
        node - node to be annotated
        configKey - name of the configuration property to be injected
      • withConfigInjection

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withConfigInjection​(T node,
                                                                                                     java.lang.String configKey)
        Annotates given node with configuration parameter injection
        Parameters:
        node - node to be annotated
        configKey - name of the configuration property to be injected
      • withConfigInjection

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withConfigInjection​(T node,
                                                                                                     java.lang.String configKey,
                                                                                                     java.lang.String defaultValue)
        Annotates given node with configuration parameter injection with default value
        Parameters:
        node - node to be annotated
        configKey - name of the configuration property to be injected
        defaultValue - value to be used in case there is no config parameter defined
      • withMessageProducer

        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)
        Annotates and enhances method used to produce messages
        Parameters:
        produceMethod - method to be annotated
        channel - channel on which messages should be produced
        event - actual data to be send
      • withSecurityRoles

        default <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withSecurityRoles​(T node,
                                                                                                           java.lang.String[] roles)
        Annotates given node with set of roles to enforce security
        Parameters:
        node - node to be annotated
        roles - roles that are allowed
      • withInitMethod

        com.github.javaparser.ast.body.MethodDeclaration withInitMethod​(com.github.javaparser.ast.expr.Expression... expression)
        Create initialization method with given expression as body
        Parameters:
        expression - body of the init method
        Returns:
        complete initialization method declaration
      • optionalInstanceInjectionType

        java.lang.String optionalInstanceInjectionType()
        Returns type that allows to inject optional instances of the same type
        Returns:
        fully qualified class name
      • optionalInstanceExists

        com.github.javaparser.ast.expr.Expression optionalInstanceExists​(java.lang.String fieldName)
        Creates an expression that represents optional instance for given field
        Parameters:
        fieldName - name of the field that should be considered optional
        Returns:
        complete expression for optional instance
      • getOptionalInstance

        default com.github.javaparser.ast.expr.Expression getOptionalInstance​(java.lang.String fieldName)
        Creates an expression that returns instance for given optional field
        Parameters:
        fieldName - name of the optional field that should be accessed
        Returns:
        complete expression for optional instance
      • multiInstanceInjectionType

        java.lang.String multiInstanceInjectionType()
        Returns type that allows to inject multiple instances of the same type
        Returns:
        fully qualified class name
      • getMultiInstance

        com.github.javaparser.ast.expr.Expression getMultiInstance​(java.lang.String fieldName)
        Creates an expression that returns a list of instances for given multi instance field
        Parameters:
        fieldName - name of the multi field that should be accessed
        Returns:
        complete expression for multi instance
      • applicationComponentType

        java.lang.String applicationComponentType()
        Returns type that allows to mark instance as application component e.g. ApplicationScoped, Component
        Returns:
        fully qualified class name
      • emitterType

        java.lang.String emitterType​(java.lang.String dataType)
        Returns type to be used as message emitter
        Parameters:
        dataType - type of the data produces by the emitter
        Returns:
        fully qualified class name
      • objectMapperInjectorSource

        java.lang.String objectMapperInjectorSource​(java.lang.String packageName)
      • withRestClientInjection

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withRestClientInjection​(T node)
        Annotates given node with rest client injection
        Parameters:
        node - node to be annotated
      • withFunction

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withFunction​(T node)
        Annotates given node with function
        Parameters:
        node - node to be annotated
      • withCloudEventMapping

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withCloudEventMapping​(T node,
                                                                                                       java.lang.String string,
                                                                                                       java.lang.String filter)
        Annotates given node with cloud event mapping for function flow
        Type Parameters:
        T -
        Parameters:
        node - node to be annotated
        string - the trigger mapping for cloud event
        Returns:
        returns annotated node
      • withBlocking

        <T extends com.github.javaparser.ast.nodeTypes.NodeWithAnnotations<?>> T withBlocking​(T template)
        Annotates given node with blocking annotation
        Type Parameters:
        T -
        Parameters:
        node - node to be annotated
        Returns:
        returns annotated node