An AttributeDefinition object defines a description of the data type
of a property/attribute.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| public static final int | |
| public static final int | BOOLEAN
The |
| public static final int | BYTE
The |
| public static final int | CHARACTER
The |
| public static final int | DOUBLE
The |
| public static final int | FLOAT
The |
| public static final int | INTEGER
The |
| public static final int | LONG
The |
| public static final int | PASSWORD
The |
| public static final int | SHORT
The |
| public static final int | STRING
The |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The cardinality of this attribute.Return the cardinality of this attribute. |
| public String[] | Returns: Return a default value ornull if no default exists.Return a default for this attribute. |
| public String | Returns: The localized description of the definition.Return a description of this attribute. |
| public String | |
| public String | |
| public String[] | |
| public String[] | |
| public int | |
| public String |
| BIGDECIMAL | back to summary |
|---|---|
| public static final int BIGDECIMAL
Deprecated As of 1.1. The | |
| BIGINTEGER | back to summary |
|---|---|
| public static final int BIGINTEGER
Deprecated As of 1.1. The | |
| BOOLEAN | back to summary |
|---|---|
| public static final int BOOLEAN The | |
| BYTE | back to summary |
|---|---|
| public static final int BYTE The | |
| CHARACTER | back to summary |
|---|---|
| public static final int CHARACTER The | |
| DOUBLE | back to summary |
|---|---|
| public static final int DOUBLE The | |
| FLOAT | back to summary |
|---|---|
| public static final int FLOAT The | |
| INTEGER | back to summary |
|---|---|
| public static final int INTEGER The | |
| LONG | back to summary |
|---|---|
| public static final int LONG The | |
| PASSWORD | back to summary |
|---|---|
| public static final int PASSWORD The
| |
| SHORT | back to summary |
|---|---|
| public static final int SHORT The | |
| STRING | back to summary |
|---|---|
| public static final int STRING The
Attributes of this type should be stored as | |
| getCardinality | back to summary |
|---|---|
| public int getCardinality() Return the cardinality of this attribute.
The OSGi environment handles multi valued attributes in arrays ([]) or in
x = Integer.MIN_VALUE no limit, but use List x < 0 -x = max occurrences, store in List x > 0 x = max occurrences, store in array [] x = Integer.MAX_VALUE no limit, but use array [] x = 0 1 occurrence required
| |
| getDefaultValue | back to summary |
|---|---|
| public String[] getDefaultValue() Return a default for this attribute.
The object must be of the appropriate type as defined by the cardinality
and
| |
| getDescription | back to summary |
|---|---|
| public String getDescription() Return a description of this attribute. The description may be localized and must describe the semantics of this type and any constraints.
| |
| getID | back to summary |
|---|---|
| public String getID() Unique identity for this attribute.
Attributes share a global namespace in the registry. For example, an
attribute
| |
| getName | back to summary |
|---|---|
| public String getName() Get the name of the attribute. This name may be localized.
| |
| getOptionLabels | back to summary |
|---|---|
| public String[] getOptionLabels() Return a list of labels of option values.
The purpose of this method is to allow menus with localized labels. It is
associated with
If the function returns
This list must be in the same sequence as the
For example, if an attribute can have the value male, female, unknown,
this list can return (for dutch)
| |
| getOptionValues | back to summary |
|---|---|
| public String[] getOptionValues() Return a list of option values that this attribute can take.
If the function returns
Each value must be acceptable to validate() (return "") and must be a
This list must be in the same sequence as
For example, if an attribute can have the value male, female, unknown,
this list can return
| |
| getType | back to summary |
|---|---|
| public int getType() Return the type for this attribute.
Defined in the following constants which map to the appropriate Java
type.
| |
| validate | back to summary |
|---|---|
| public String validate(String value) Validate an attribute in null No validation present "" No problems detected "..." A localized description of why the value is wrongIf the cardinality of this attribute is multi-valued then this string must be interpreted as a comma delimited string. The complete value must be trimmed from white space as well as spaces around commas. Commas ( ',' \u002C) and spaces (' ' \u0020) and
backslashes ('\' \u005C) can be escaped with another
backslash. Escaped spaces must not be trimmed. For example:
value=" a\,b,b\,c,\ c\\,d " => [ "a,b", "b,c", " c\", "d" ] | |