@Target(value={})
public @interface Property
ConfigurationDescription.
When a property is declared in a configuration description of a component,
the configuration (in the form of a Properties-object)
that is received by an instance of that component always contains a
value for that property. This value was either explicitly set in the
configuration or it's the default value assigned to the property.
A property is either required or a
default value that matches the type
and the restrictions of the property must be
specified. The default default value is the empty string, so omitting
the default value of an optional property may work where it fits the type and
restrictions.
TODO: Where to use the description? Add it to the exception message in case of illegal property values? Might also be used in a graphical configuration tool (if we should ever get one).
| Modifier and Type | Required Element and Description |
|---|---|
java.lang.String |
name
The name of the property, e.g.
|
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
defaultNull
Whether an empty string as default value is to be interpreted as
null. |
java.lang.String |
defaultValue
The default value of the property.
|
java.lang.String |
description
A short description of the component.
|
boolean |
documentationOnly
Whether the configuration description is only for documentation purpose, that is, it should be
part of the generated configuration documentation but it should not be considered within the
actual configuration.
|
boolean |
isRequired
Whether the property is required in configurations.
|
java.lang.String[] |
restrictions
Further restrictions on the allowed values of a property.
|
Property.Type |
type
See
Property.Type for more information on which string values are legal
string representations of the respective type. |
public abstract java.lang.String name
isCaching.public abstract java.lang.String description
public abstract boolean isRequired
defaultValue() will be used (i.e. it will be transparently filled
into the configuration of the component.
Please note, in case of Property.Type.STRING, a required property also
means the value must be non-empty!
public abstract Property.Type type
Property.Type for more information on which string values are legal
string representations of the respective type.public abstract java.lang.String defaultValue
isRequired() is set to
true the defaultValue is ignored. Otherwise it has to be a
legal string representation of the type defined in type(). If
the property is not required and no default value is provided, the empty
string will be used, that is, the empty string is the default for the
default value.public abstract boolean defaultNull
null. This attribute is only relevant in case the default
value is set to the empty string (or not provided at all).null instead of the empty string.public abstract boolean documentationOnly
public abstract java.lang.String[] restrictions
<restrictionType>: <restrictionData>
or <restrictionType>/<restrictionOptions>: <restrictionData>.
The following restriction types are available:
oneof: apple, orange, bananaoneof/i: apple, orange, banana (case-insensitive
comparison)x can be used as a wildcard.length: 5 (a fixed length)length: 1 to 6 length: 1 to x (minimum length of 1 and no maximum length)pattern: prefix.*Pattern for more information an regular
expression patterns in Java.x can be used as a wildcard. Intervals may be open ((
or closed ([) (closed is default if omitted).range: 1 to 6 (values between 1 and 6, boundaries
included)range: [1 to 6] (equal to previous example)range: 0 to 1) (values between 0 and 1, right boundary not
included)range: 5 to x (minimum of 5, no maximum)range: x to 8 (maximum of 8, no minimum)