@Documented @Retention(value=RUNTIME) @Target(value={PACKAGE,TYPE,ANNOTATION_TYPE,METHOD}) @Repeatable(value=Requirements.class) public @interface Requires
Configuration
.Modifier and Type | Optional Element and Description |
---|---|
Class[] |
beans
Expresses that beans of the given types should be available for the bean or configuration to load.
|
Class[] |
classes
Expresses the given classes that should be present on the classpath for the bean or configuration to load.
|
Class<? extends Condition> |
condition
One ore more custom condition classes.
|
String |
configuration
Expresses the configurations that should be present for the bean or configuration to load.
|
String |
defaultValue |
Class<? extends Annotation>[] |
entities
Expresses that the configuration requires entities annotated with the given annotations to be available to the
application via package scanning.
|
String[] |
env
Expresses that the configuration will only load within the given environments.
|
Class[] |
missing
Expresses the given classes that should be missing from the classpath for the bean or configuration to load.
|
Class[] |
missingBeans
Expresses the given beans that should be missing from the classpath for the bean or configuration to load.
|
String[] |
missingClasses
Expresses the given class names should be missing from the classpath for the bean configuration to load.
|
String[] |
missingConfigurations
Expresses the given configurations that should be missing from the classpath for the bean or configuration to
load.
|
String |
missingProperty
Expresses that the bean or configuration will only be configured if the given property is missing.
|
String[] |
notEnv
Expresses that the configuration will not load within the given environments.
|
String |
notEquals
Constraint a property to not equal the given value.
|
String |
pattern
Used in combination with
property() to express the required pattern of the property. |
String |
property
Expresses that the given property should be set for the bean to load.
|
String[] |
resources
Expresses the given resources should exist for the bean configuration to load.
|
Requires.Sdk |
sdk
Used to express an SDK requirement.
|
String |
value
Used in combination with
property() to express the required value of the property. |
String |
version
Used in combination with
sdk() , configuration() , classes() or beans() to
express a minimum version of the SDK, configuration or classes. |
public abstract String[] env
public abstract String[] notEnv
public abstract String property
public abstract String notEquals
@InstantiatedMember public abstract Class<? extends Condition> condition
public abstract Requires.Sdk sdk
version()
to specify a minimum
version requirement.public abstract String configuration
public abstract String value
property()
to express the required value of the property.public abstract String defaultValue
public abstract String pattern
property()
to express the required pattern of the property. The
pattern will be evaluated with String.matches(String)
.public abstract String version
sdk()
, configuration()
, classes()
or beans()
to
express a minimum version of the SDK, configuration or classes.public abstract Class[] classes
public abstract Class<? extends Annotation>[] entities
public abstract Class[] beans
public abstract Class[] missing
public abstract Class[] missingBeans
public abstract String[] missingConfigurations
public abstract String missingProperty
public abstract String[] resources
ResourceResolver
can read, eg:
file:/path/to/file.txt classpath:com/mycompany/file.txt