...
Name | Default Value | Required | SCR | Metatype | Description | ||
name | The name of constant | yes | | | The name of the property. If this tag is defined on a field with an initialization expression, the value of that expression is used as the name if the field is of type | ||
value | no | | | The string value of the property. This can either be a single value or an array. | |||
longValue | no | | | The long value of the property. This can either be a single value or an array. | |||
doubleValue | no | | | The double value of the property. This can either be a single value or an array. | |||
floatValue | no | | | The float value of the property. This can either be a single value or an array. | |||
intValue | no | | | The int value of the property. This can either be a single value or an array. | |||
byteValue | no | | | The byte value of the property. This can either be a single value or an array. | |||
charValue | no | | | The char value of the property. This can either be a single value or an array. | |||
boolValue | no | | | The boolean value of the property. This can either be a single value or an array. | |||
shortValue | no | | | The short value of the property. This can either be a single value or an array. | |||
label | | no | | The label to display in a form to configure this property. This name may be localized by prepending a | |||
description | | no | | A descriptive text to provide the client in a form to configure this property. This name may be localized by prepending a | |||
propertyPrivate | Depending on the name | no | See description | Boolean flag defining whether a metatype descriptor entry should be generated for this property or not. By default a metatype descriptor entry, i.e. an | |||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="62ab7cf0d88ae0d7-70136249-40e94df7-b8a4b89a-612348148c70de0c17fd8fd1"><ac:plain-text-body><![CDATA[ | cardinality | Depends on property value(s) | no | | Defines the cardinality of the property and its collection type. If the cardinality is negative, the property is expected to be stored in a | ]]></ac:plain-text-body></ac:structured-macro> | |
options | no | See below | See below for a description of the |
...
Some properties may only be set to a set of possible values. To support user interfaces which provide a selection list of values or a list of checkboxes the option values and labels may be defined as parameters to the scr.property
tag Property
annotation. All parameters in the form of name-value pairs occurring after the options
parameter attribute are used to build the list of available value options. The parameter name is used as the value while the parameter value is used as the label in the user interface. This label may be prepended with a %
sign to localize the string.
...
Please note, that all parameters of the scr.property
tag Property
annotation occurring after the options
parameter are used to build the options list. Hence no non-option value parameters should actually follow the options
parameter.
...
Generally the value of a property is scalar, that is a property has a single value such as true
, 5
or "This is a String"
. Such scalar values are defined with the different value
parameter attributes of the scrProperty
annotation. property tag. In the case of a scalar property value, the cardinality
parameter value is assumed to be 0
(zero) unless of course set otherwise.
There may be properties, which have a list of values, such as a list of possible URL mappings for an URL Mapper. Such multiple values are defined in one more parameters whose name starts with values
. Each parameter must of course have a unique name which is not in any except to differentiate the parametersjust by comma separate as the value of the annotation parameter.
If the cardinality of the property is not explicilty set with the cardinality
property, it defaults to Integer.MAX_INT
, i.e. unbound array, if multiple values with a series of values parameters are defined. Otherwise the cardinality
parameter may be set for example to a negative value to store the values in a java.util.Vector
instead.
...
The Reference
annotation defines references to other services made available to the component by the Service Component Runtime. This tag
This tag annotation may be declared in the java Class comment on a Class level or any Java Field field to which it might apply. Depending on where the tag annotation is declared, the parameters may have different default values.
This tag annotation is used to declare <reference>
elements of the component declaration. See section 112.4.7, Reference Element, in the OSGi Service Platform Service Compendium Specification for more information.
...
Name | Default Value | Required | Descriptor | Description | ||
name | Name of the field | yes | | The local name of the reference. If the | ||
interface | Type of the field | yes | | The name of the service interface. This name is used by the Service Component Runtime to access the service on behalf of the component. If the | cardinality | |
no | reference. cardinality | The cardinality of the service reference. This must be one of | no | | The cardinality of the service reference. This must be one of value from the enumeration | |
policy | | no | | The dynamicity policy of the reference. If | ||
target | no | | A service target filter to select specific services to be made available. In order to be able to overwrite the value of this value by a configuration property, this parameter must be declared. If the parameter is not declared, the respective declaration attribute will not be generated | |||
bind | See description | no | | The name of the method to be called when the service is to be bound to the component. The default value is the name created by appending the reference | ||
unbind | See description | no | | The name of the method to be called when the service is to be unbound from the component. The default value is the name created by appending the reference | ||
strategy | | no | | The strategy used for this reference, one of |
---|
Notes:
- If you define a reference on a field with a strategy of
event
and there is no bind or unbind method, the plugin will create the necessary methods.
...
Name | Default Value | Required | SCR | Metatype | Description | ||
name | The name of constant | yes | | | The name of the property. If this tag is defined on a field with an initialization expression, the value of that expression is used as the name if the field is of type | ||
value | no | | | The value of the property. If the property type is not | |||
type | | no | | | The type of the property value. This must be one of | ||
label | | no | | The label to display in a form to configure this property. This name may be localized by prepending a | |||
description | | no | | A descriptive text to provide the client in a form to configure this property. This name may be localized by prepending a | |||
private | Depending on the name | no | See description | Boolean flag defining whether a metatype descriptor entry should be generated for this property or not. By default a metatype descriptor entry, i.e. an | |||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="d76c01809192fc1b-18e40555-426c45a4-a5adb694-a8a536445f46aa6e562922b7"><ac:plain-text-body><![CDATA[ | cardinality | Depends on property value(s) | no | | Defines the cardinality of the property and its collection type. If the cardinality is negative, the property is expected to be stored in a | ]]></ac:plain-text-body></ac:structured-macro> | |
options | no | See below | See below for a description of the | ||||
values* | no | See below | See below for a description of parameters starting with | ||||
valueRef | no | | A constant containing the value for this property. The constant can either be declared in the same class as this property or in any class that is imported. The type of the property is derived from the constant. | ||||
valueRefs | no | See below | Same as the |
...
The scr.reference
tag defines references to other services made available to the component by the Service Component Runtime. This tag
This tag may be declared in the java Class comment or any Java Field to which it might apply. Depending on where the tag is declared, the parameters may have different default values.
...
Name | Default Value | Required | Descriptor | Description |
name | Name of the field | yes | | The local name of the reference. If the |
interface | Type of the field | yes | | The name of the service interface. This name is used by the Service Component Runtime to access the service on behalf of the component. If the |
cardinality | | no | | The cardinality of the service reference. This must be one of |
policy | | no | | The dynamicity policy of the reference. If |
target | no | | A service target filter to select specific services to be made available. In order to be able to overwrite the value of this value by a configuration property, this parameter must be declared. If the parameter is not declared, the respective declaration attribute will not be generated | |
bind | See description | no | | The name of the method to be called when the service is to be bound to the component. The default value is the name created by appending the reference |
unbind | See description | no | | The name of the method to be called when the service is to be unbound from the component. The default value is the name created by appending the reference |
strategy | | no | | The strategy used for this reference, one of |
---|
Notes:
- If you define a reference on a field with the strategy
event
and there is no bind or unbind method, the plugin will create the necessary methods.
...