|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface AttributeDefinitionEx
This interface extends AttributeDefinition in order to provide
means, not defined by standard metatype API.
| Field Summary | |
|---|---|
static int |
DICTIONARY
The DICTIONARY type. |
static java.lang.String |
HIDDEN
This constant defines a key for attribute extension properties. |
static java.lang.String |
MAXIMUM
This constant defines a key for attribute extension properties. |
static java.lang.String |
MINIMUM
This constant defines a key for attribute extension properties. |
static java.lang.String |
READ_ONLY
This constant defines a key for attribute extension properties. |
static java.lang.String |
STEP
This constant defines a key for attribute extension properties. |
| Fields inherited from interface org.osgi.service.metatype.AttributeDefinition |
|---|
BIGDECIMAL, BIGINTEGER, BOOLEAN, BYTE, CHARACTER, DOUBLE, FLOAT, INTEGER, LONG, SHORT, STRING |
| Method Summary | |
|---|---|
java.lang.String[] |
getDefaultValue()
Return a default for this attribute. |
java.lang.String |
getModifier(java.lang.String key)
Returns the value associated with the given key concerning this attribute. |
java.lang.String[] |
getModifierKeys()
Returns a set of modifier keys for this attribute definition. |
java.util.Dictionary |
getProperties()
Returns the additional properties, contained in the configuration xml meta data by the key tag. |
int |
getType(java.lang.String key)
Returns the type of the object corresponding to the specified key when this object is kept as dictionary. |
java.lang.String[] |
validate(java.lang.String[] values)
Validates the specified value argument as if a value for the key argument. |
| Methods inherited from interface org.osgi.service.metatype.AttributeDefinition |
|---|
getCardinality, getDescription, getID, getName, getOptionLabels, getOptionValues, getType, validate |
| Field Detail |
|---|
static final int DICTIONARY
java.util.Dictionary objects,
where keys are Strings and values are of the single types
definied by the standard metatype API.
The method getCardinality() value MUST always return 0.
static final java.lang.String MINIMUM
static final java.lang.String MAXIMUM
static final java.lang.String STEP
static final java.lang.String HIDDEN
static final java.lang.String READ_ONLY
| Method Detail |
|---|
java.util.Dictionary getProperties()
key tag.
It usually holds info about min and max values of an attribute.
null if no tag key.int getType(java.lang.String key)
DICTIONARY.
For available keys see getDefaultValue().
key - The key of the object whose type is requested.
java.lang.String[] validate(java.lang.String[] values)
0 cardinality.
values - array of String with even length where representing
a dictionary where keys are on even an values are on odd positions.
0, the returned array
must be of the same length as the values argument length. Error at index i
respects to value at the same index.
2) Attribute IS of type DICTIONARY. If passed values argument is not of even length
IllegalArgumentException will be thrown, otherwise String array of even length is constructed and
value at even positions are keys & the corresponding error is on next position.
3) When object IS NOT of type DICTIONARY - IllegalArgumentException will be thrown.
java.lang.IllegalArgumentException - is thrown if method is not used as expected.java.lang.String[] getDefaultValue()
getType(String), for the corresponding key. Default value can also be null
with the meaning the key presence is optional within the dictionary.
2) The object must be of the appropriate type as defined
by the cardinality and getType(String).
The returned array is a list of String objects that can be converted to the
appropriate type.
The cardinality of the return array must follow the
absolute cardinality of this type. E.g. if the cardinality = 0, the
array must contain 1 element. If the cardinality is 1, it
must contain 0 or 1 elements. If it is -5, it must contain
from 0 to max 5 elements. Note that the special case of a 0 cardinality,
meaning a single value, does not allow arrays or vectors of 0 elements.
getDefaultValue in interface AttributeDefinitionjava.lang.String[] getModifierKeys()
AttributeDefinition interface
and are used for the needs of the ConfigurationAdmin Service.
Strings.java.lang.String getModifier(java.lang.String key)
key - name of the modifier
null is returned.getModifierKeys()
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||