org.apache.felix.scr.annotations

## Annotation Type Property

Deprecated.
Use the OSGi annotations from org.osgi.service.component.annotations.*

    @Target(value={TYPE,FIELD})
    @Retention(value=CLASS)
    @Documented
    @Deprecated
    public @interface Property

The `Property` annotation defines properties which are made available to the component through the ComponentContext.getProperties() method. These annotations are not strictly required but may be used by components to defined initial configuration. Additionally properties may be set here to identify the component if it is registered as a service, for example the service.description and service.vendor properties.

This tag is used to declare <property> elements of the component declaration. See section 112.4.5, Properties and Property Elements, in the OSGi Service Platform Service Compendium Specification for more information.

### Optional Element Summary

Optional Elements
`boolean[]` `boolValue` Deprecated. The bool value(s) of the property.
`byte[]` `byteValue` Deprecated. The byte value(s) of the property.
`int` `cardinality` Deprecated. Defines the cardinality of the property and its collection type.
`char[]` `charValue` Deprecated. The char value(s) of the property.
`Class<?>[]` `classValue` Deprecated. The class value(s) of the property.
`String` `description` Deprecated. A descriptive text to provide the client in a form to configure this property.
`double[]` `doubleValue` Deprecated. The double value(s) of the property.
`float[]` `floatValue` Deprecated. The float value(s) of the property.
`int[]` `intValue` Deprecated. The int value(s) of the property.
`String` `label` Deprecated. The label to display in a form to configure this property.
`long[]` `longValue` Deprecated. The long value(s) of the property.
`String` `name` Deprecated. The name of the property
`PropertyOption[]` `options` Deprecated. Some properties may only be set to a set of possible values.
`String[]` `passwordValue` Deprecated. The password value(s) of the property.
`boolean` `propertyPrivate` Deprecated. Boolean flag defining whether a metatype descriptor entry should be generated for this property or not.
`short[]` `shortValue` Deprecated. The short value(s) of the property.
`PropertyUnbounded` `unbounded` Deprecated. This defines if the property is unbounded.
`String[]` `value` Deprecated. The value(s) of the property.

### Element Detail

#### name

    public abstract String name

Deprecated.
The name of the property

Default:
  ""

#### label

    public abstract String label

Deprecated.
The label to display in a form to configure this property. This name may be localized by prepending a % sign to the name. Default value: %<name>.name

Default:
  ""

#### description

    public abstract String description

Deprecated.
A descriptive text to provide the client in a form to configure this property. This name may be localized by prepending a % sign to the name. Default value: %<name>.description

Default:
  ""

#### value

    public abstract String[] value

Deprecated.
The value(s) of the property. If the property type is not String, parsing of the value is done using the valueOf(String) method of the class defined by the property type. This attribute should not be used in combination with any of the other value attributes.

Default:
  {}

#### classValue

    public abstract Class<?>[] classValue

Deprecated.
The class value(s) of the property. This attribute should not be used in combination with any of the other value attributes or the type attribute.

Since:
  1.5

Default:
  {}

#### longValue

    public abstract long[] longValue

Deprecated.
The long value(s) of the property. This attribute should not be used in combination with any of the other value attributes or the type attribute.

Default:
  {}

#### doubleValue

    public abstract double[] doubleValue

Deprecated.
The double value(s) of the property. This attribute should not be used in combination with any of the other value attributes.

Default:
  {}

#### floatValue

    public abstract float[] floatValue

Deprecated.
The float value(s) of the property. This attribute should not be used in combination with any of the other value attributes or the type attribute.

Default:
  {}

#### intValue

    public abstract int[] intValue

Deprecated.
The int value(s) of the property. This attribute should not be used in combination with any of the other value attributes or the type attribute.

Default:
  {}

#### byteValue

    public abstract byte[] byteValue

Deprecated.
The byte value(s) of the property. This attribute should not be used in combination with any of the other value attributes or the type attribute.

Default:
  {}

#### charValue

    public abstract char[] charValue

Deprecated.
The char value(s) of the property. This attribute should not be used in combination with any of the other value attributes or the type attribute.

Default:
  {}

#### boolValue

    public abstract boolean[] boolValue

Deprecated.
The bool value(s) of the property. This attribute should not be used in combination with any of the other value attributes or the type attribute.

Default:
  {}

#### shortValue

    public abstract short[] shortValue

Deprecated.
The short value(s) of the property. This attribute should not be used in combination with any of the other value attributes or the type attribute.

Default:
  {}

#### passwordValue

    public abstract String[] passwordValue

Deprecated.
The password value(s) of the property. This attribute should not be used in combination with any of the other value attributes or the type attribute.

Since:
  1.8.0

Default:
  {}

#### cardinality

    public abstract int cardinality

Deprecated.
Defines the cardinality of the property and its collection type. If the cardinality is negative, the property is expected to be stored in a `Vector` (primitive types such as boolean are boxed in the Wrapper class), if the cardinality is positive, the property is stored in an array (primitve types are unboxed, that is Boolean type values are stored in boolean[]). The actual value defines the maximum number of elements in the vector or array. If the cardinality is zero, the property is a scalar value. If the defined value of the property is set in the value attribute, the cardinality defaults to 0 (zero for scalar value). If the property is defined in one or more properties starting with values, the cardinality defaults to an unbounded array.

Default:
  0

#### unbounded

    public abstract PropertyUnbounded unbounded

Deprecated.
This defines if the property is unbounded. The property can either be an unbounded array or vector. If this attribute is set to any other value than `PropertyUnbounded.DEFAULT`, this overrides the `cardinality()`.

Since:
  1.4

Default:
  org.apache.felix.scr.annotations.PropertyUnbounded.DEFAULT

#### propertyPrivate

    public abstract boolean propertyPrivate

Deprecated.
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 `AD` element, is generated. If a property should not be available for display in a configuration user interface, this parameter should be set to `true`. For properties names `service.ranking` the `AD` element is not created by default, which can be overwritten by stating `propertyPrivate=false`. For the predefined properties `service.pid`, `service.description`, `service.id`, `service.vendor`, `service.bundlelocation` and `service.factoryPid` an `AD` element will never be created and the `propertyPrivate` attribute has no effect.

Default:
  false

#### options

    public abstract PropertyOption[] options

Deprecated.
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 `Property` annotation. All parameters in the form of name-value pairs 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.

The options are written to the metatype.xml file as Option elements inside the AD element defining the property. The name of the parameter will be used for the Option.value attribute while the value of the parameter defines the Option.label attribute.

Default:
  {}