Annotation Interface Requires


Expresses a requirement for a bean or Configuration.
Since:
1.0
Author:
Graeme Rocher
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Used to express an operation system family.
    static enum 
    Used to express a required SDK version.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Expresses that the bean the given class should be available for the bean or configuration to load.
    Used in combination with bean() to express that the given bean property should be set for the bean to load.
    Class<?>[]
    Expresses that beans of the given types should be available for the bean or configuration to load.
    Class<?>[]
    Expresses the given classes that should be present on the classpath for the bean or configuration to load.
    Class<? extends Condition>
    One ore more custom condition classes.
    Expresses the configurations that should be present for the bean or configuration to load.
     
    Class<? extends Annotation>[]
    Expresses that the configuration requires entities annotated with the given annotations to be available to the application via package scanning.
    Expresses that the configuration will only load within the given environments.
    Class<?>[]
    Expresses the given classes that should be missing from the classpath for the bean or configuration to load.
    Expresses the given beans that should be missing from the classpath for the bean or configuration to load.
    Expresses the given class names should be missing from the classpath for the bean configuration to load.
    Expresses the given configurations that should be missing from the classpath for the bean or configuration to load.
    Expresses that the bean or configuration will only be configured if the given property is missing.
    Expresses that the configuration will not load within the given environments.
    Constraint a property to not equal the given value.
    Expresses the current operating system must not be one in the given list.
    Expresses the current operating system must be one in the given list.
    Used in combination with property() to express the required pattern of the property.
    Expresses that the given property should be set for the bean to load.
    Expresses the given resources should exist for the bean configuration to load.
    Used to express an SDK requirement.
    Used in combination with property() to express the required value of the property.
    Used in combination with sdk(), configuration(), classes() or beans() to express a minimum version of the SDK, configuration or classes.
  • Element Details

    • env

      String[] env
      Expresses that the configuration will only load within the given environments.
      Returns:
      The names of the environments this configuration will load in
      Default:
      {}
    • notEnv

      String[] notEnv
      Expresses that the configuration will not load within the given environments.
      Returns:
      The names of the environments this configuration will not load in
      Default:
      {}
    • property

      String property
      Expresses that the given property should be set for the bean to load.
      Returns:
      The property that should be set.
      Default:
      ""
    • notEquals

      String notEquals
      Constraint a property to not equal the given value.
      Returns:
      The value to not equal
      Default:
      ""
    • condition

      @InstantiatedMember Class<? extends Condition> condition
      One ore more custom condition classes.
      Returns:
      The condition classes
      Default:
      io.micronaut.context.condition.TrueCondition.class
    • sdk

      Used to express an SDK requirement. Typically used in combination with version() to specify a minimum version requirement.
      Returns:
      The SDK required
      Default:
      MICRONAUT
    • configuration

      String configuration
      Expresses the configurations that should be present for the bean or configuration to load.
      Returns:
      The configurations
      Default:
      ""
    • value

      String value
      Used in combination with property() to express the required value of the property.
      Returns:
      The required value
      Default:
      ""
    • defaultValue

      String defaultValue
      Returns:
      The default value if no value is specified
      Default:
      ""
    • pattern

      String pattern
      Used in combination with property() to express the required pattern of the property. The pattern will be evaluated with String.matches(String).
      Returns:
      The required pattern
      Default:
      ""
    • version

      String version
      Used in combination with sdk(), configuration(), classes() or beans() to express a minimum version of the SDK, configuration or classes.
      Returns:
      The minimum version
      Default:
      ""
    • classes

      Class<?>[] classes
      Expresses the given classes that should be present on the classpath for the bean or configuration to load.
      Returns:
      The classes
      Default:
      {}
    • entities

      Class<? extends Annotation>[] entities
      Expresses that the configuration requires entities annotated with the given annotations to be available to the application via package scanning.
      Returns:
      The classes
      Default:
      {}
    • beans

      Class<?>[] beans
      Expresses that beans of the given types should be available for the bean or configuration to load.
      Returns:
      The beans
      Default:
      {}
    • missing

      Class<?>[] missing
      Expresses the given classes that should be missing from the classpath for the bean or configuration to load.
      Returns:
      The classes
      Default:
      {}
    • missingClasses

      @AliasFor(member="missing") String[] missingClasses
      Expresses the given class names should be missing from the classpath for the bean configuration to load.
      Returns:
      The names of the classes that should be missing
      Default:
      {}
    • missingBeans

      Class[] missingBeans
      Expresses the given beans that should be missing from the classpath for the bean or configuration to load.
      Returns:
      The classes
      Default:
      {}
    • missingConfigurations

      String[] missingConfigurations
      Expresses the given configurations that should be missing from the classpath for the bean or configuration to load.
      Returns:
      The classes
      Default:
      {}
    • missingProperty

      String missingProperty
      Expresses that the bean or configuration will only be configured if the given property is missing.
      Returns:
      The property or properties that should be missing
      Default:
      ""
    • resources

      String[] resources
      Expresses the given resources should exist for the bean configuration to load. Resources can be anything that ResourceResolver can read, eg:
        file:/path/to/file.txt
        classpath:com/mycompany/file.txt
       
      Returns:
      The file paths
      Default:
      {}
    • os

      Expresses the current operating system must be one in the given list.
      Returns:
      The os families
      Default:
      {}
    • notOs

      Expresses the current operating system must not be one in the given list.
      Returns:
      The os families
      Default:
      {}
    • bean

      Class<?> bean
      Expresses that the bean the given class should be available for the bean or configuration to load. Can be used in combination with beanProperty() to specify the required bean property
      Returns:
      The configuration properties class
      Since:
      3.4.0
      Default:
      void.class
    • beanProperty

      String beanProperty
      Used in combination with bean() to express that the given bean property should be set for the bean to load.
      Returns:
      The configuration property that should be set.
      Since:
      3.4.0
      Default:
      ""