@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 |
---|---|
java.lang.Class[] |
beans
Expresses that beans of the given types should be available for the bean or configuration to load.
|
java.lang.Class[] |
classes
Expresses the given classes that should be present on the classpath for the bean or configuration to load.
|
java.lang.Class<? extends Condition> |
condition
One ore more custom condition classes.
|
java.lang.String |
configuration
Expresses the configurations that should be present for the bean or configuration to load.
|
java.lang.String |
defaultValue |
java.lang.Class<? extends java.lang.annotation.Annotation>[] |
entities
Expresses that the configuration requires entities annotated with the given annotations to be available to the
application via package scanning.
|
java.lang.String[] |
env
Expresses that the configuration will only load within the given environments.
|
java.lang.Class[] |
missing
Expresses the given classes that should be missing from the classpath for the bean or configuration to load.
|
java.lang.Class[] |
missingBeans
Expresses the given beans that should be missing from the classpath for the bean or configuration to load.
|
java.lang.String[] |
missingClasses
Expresses the given class names should be missing from the classpath for the bean configuration to load.
|
java.lang.String[] |
missingConfigurations
Expresses the given configurations that should be missing from the classpath for the bean or configuration to
load.
|
java.lang.String |
missingProperty
Expresses that the bean or configuration will only be configured if the given property is missing.
|
java.lang.String[] |
notEnv
Expresses that the configuration will not load within the given environments.
|
java.lang.String |
notEquals
Constraint a property to not equal the given value.
|
Requires.Family[] |
notOs
Expresses the current operating system must not be one in the given list.
|
Requires.Family[] |
os
Expresses the current operating system must be one in the given list.
|
java.lang.String |
pattern
Used in combination with
property() to express the required pattern of the property. |
java.lang.String |
property
Expresses that the given property should be set for the bean to load.
|
java.lang.String[] |
resources
Expresses the given resources should exist for the bean configuration to load.
|
Requires.Sdk |
sdk
Used to express an SDK requirement.
|
java.lang.String |
value
Used in combination with
property() to express the required value of the property. |
java.lang.String |
version
Used in combination with
sdk() , configuration() , classes() or beans() to
express a minimum version of the SDK, configuration or classes. |
public abstract java.lang.String[] env
public abstract java.lang.String[] notEnv
public abstract java.lang.String property
public abstract java.lang.String notEquals
@InstantiatedMember public abstract java.lang.Class<? extends Condition> condition
public abstract Requires.Sdk sdk
version()
to specify a minimum
version requirement.public abstract java.lang.String configuration
public abstract java.lang.String value
property()
to express the required value of the property.public abstract java.lang.String defaultValue
public abstract java.lang.String pattern
property()
to express the required pattern of the property. The
pattern will be evaluated with String.matches(String)
.public abstract java.lang.String version
sdk()
, configuration()
, classes()
or beans()
to
express a minimum version of the SDK, configuration or classes.public abstract java.lang.Class[] classes
public abstract java.lang.Class<? extends java.lang.annotation.Annotation>[] entities
public abstract java.lang.Class[] beans
public abstract java.lang.Class[] missing
public abstract java.lang.Class[] missingBeans
public abstract java.lang.String[] missingConfigurations
public abstract java.lang.String missingProperty
public abstract java.lang.String[] resources
ResourceResolver
can read, eg:
file:/path/to/file.txt classpath:com/mycompany/file.txt
public abstract Requires.Family[] os
public abstract Requires.Family[] notOs