Package io.micronaut.context.annotation
Annotation Type Requires
-
@Documented @Retention(RUNTIME) @Target({PACKAGE,TYPE,ANNOTATION_TYPE,METHOD,FIELD}) @Repeatable(Requirements.class) public @interface RequiresExpresses a requirement for a bean orConfiguration.- Since:
- 1.0
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.ClassbeanExpresses that the bean the given class should be available for the bean or configuration to load.java.lang.StringbeanPropertyUsed in combination withbean()to express that the given bean property should be set for the bean to load.java.lang.Class[]beansExpresses that beans of the given types should be available for the bean or configuration to load.java.lang.Class[]classesExpresses the given classes that should be present on the classpath for the bean or configuration to load.java.lang.Class<? extends Condition>conditionOne ore more custom condition classes.java.lang.StringconfigurationExpresses the configurations that should be present for the bean or configuration to load.java.lang.StringdefaultValuejava.lang.Class<? extends java.lang.annotation.Annotation>[]entitiesExpresses that the configuration requires entities annotated with the given annotations to be available to the application via package scanning.java.lang.String[]envExpresses that the configuration will only load within the given environments.java.lang.Class[]missingExpresses the given classes that should be missing from the classpath for the bean or configuration to load.java.lang.Class[]missingBeansExpresses the given beans that should be missing from the classpath for the bean or configuration to load.java.lang.String[]missingClassesExpresses the given class names should be missing from the classpath for the bean configuration to load.java.lang.String[]missingConfigurationsExpresses the given configurations that should be missing from the classpath for the bean or configuration to load.java.lang.StringmissingPropertyExpresses that the bean or configuration will only be configured if the given property is missing.java.lang.String[]notEnvExpresses that the configuration will not load within the given environments.java.lang.StringnotEqualsConstraint a property to not equal the given value.Requires.Family[]notOsExpresses the current operating system must not be one in the given list.Requires.Family[]osExpresses the current operating system must be one in the given list.java.lang.StringpatternUsed in combination withproperty()to express the required pattern of the property.java.lang.StringpropertyExpresses that the given property should be set for the bean to load.java.lang.String[]resourcesExpresses the given resources should exist for the bean configuration to load.Requires.SdksdkUsed to express an SDK requirement.java.lang.StringvalueUsed in combination withproperty()to express the required value of the property.java.lang.StringversionUsed in combination withsdk(),configuration(),classes()orbeans()to express a minimum version of the SDK, configuration or classes.
-
-
-
-
condition
@InstantiatedMember java.lang.Class<? extends Condition> condition
One ore more custom condition classes.- Returns:
- The condition classes
- Default:
- io.micronaut.context.condition.TrueCondition.class
-
-
-
sdk
Requires.Sdk sdk
Used to express an SDK requirement. Typically used in combination withversion()to specify a minimum version requirement.- Returns:
- The SDK required
- Default:
- io.micronaut.context.annotation.Requires.Sdk.MICRONAUT
-
-
-
value
java.lang.String value
Used in combination withproperty()to express the required value of the property.- Returns:
- The required value
- Default:
- ""
-
-
-
pattern
java.lang.String pattern
Used in combination withproperty()to express the required pattern of the property. The pattern will be evaluated withString.matches(String).- Returns:
- The required pattern
- Default:
- ""
-
-
-
version
java.lang.String version
Used in combination withsdk(),configuration(),classes()orbeans()to express a minimum version of the SDK, configuration or classes.- Returns:
- The minimum version
- Default:
- ""
-
-
-
os
Requires.Family[] os
Expresses the current operating system must be one in the given list.- Returns:
- The os families
- Default:
- {}
-
-
-
notOs
Requires.Family[] notOs
Expresses the current operating system must not be one in the given list.- Returns:
- The os families
- Default:
- {}
-
-
-
bean
java.lang.Class bean
Expresses that the bean the given class should be available for the bean or configuration to load. Can be used in combination withbeanProperty()to specify the required bean property- Returns:
- The configuration properties class
- Since:
- 3.4.0
- Default:
- void.class
-
-
-
beanProperty
java.lang.String beanProperty
Used in combination withbean()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:
- ""
-
-