Class PropertyMetaDataImpl
java.lang.Object
org.apache.felix.dm.impl.metatype.PropertyMetaDataImpl
- All Implemented Interfaces:
PropertyMetaData
DependencyManager PropertyMetaData Implementation. This class describes meta informations regarding
one given configuration property.
- Author:
- Felix Project Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn a list of valid options for this property (the labels may be localized).intString[]getId()String[]String[]intgetType()booleansetCardinality(int cardinality) Return the cardinality of this property.setDefaults(String[] defaults) Returns a default for this property.setDescription(String description) Returns the property description.setHeading(String heading) The label used to display the property.The key of a ConfigurationAdmin property.setRequired(boolean required) Tells if this property is required or not.Returns the property primitive type.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.felix.dm.PropertyMetaData
setDefaults
-
Constructor Details
-
PropertyMetaDataImpl
public PropertyMetaDataImpl()
-
-
Method Details
-
addOption
Description copied from interface:PropertyMetaDataReturn a list of valid options for this property (the labels may be localized).- Specified by:
addOptionin interfacePropertyMetaData- Returns:
- the list of valid options for this property.
-
setCardinality
Description copied from interface:PropertyMetaDataReturn the cardinality of this property. The OSGi environment handles multi valued properties in arrays ([]) or in Vector objects. The return value is defined as follows:- x = Integer.MIN_VALUE no limit, but use Vector
- x invalid input: '<' 0 -x = max occurrences, store in Vector
- x > 0 x = max occurrences, store in array []
- x = Integer.MAX_VALUE no limit, but use array []
- x = 0 1 occurrence required
- Specified by:
setCardinalityin interfacePropertyMetaData
-
setDefaults
Description copied from interface:PropertyMetaDataReturns a default for this property. The object must be of the appropriate type as defined by the cardinality and getType(). The return type 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.- Specified by:
setDefaultsin interfacePropertyMetaData
-
setDescription
Description copied from interface:PropertyMetaDataReturns the property description. The description may be localized and must describe the semantics of this type and any constraints. Example: "Select the log level for the Printer Service".- Specified by:
setDescriptionin interfacePropertyMetaData- Returns:
- a localizable description of the property.
-
setHeading
Description copied from interface:PropertyMetaDataThe label used to display the property. Example: "Log Level".- Specified by:
setHeadingin interfacePropertyMetaData- Returns:
- The label used to display the property (may be localized)
-
setId
Description copied from interface:PropertyMetaDataThe key of a ConfigurationAdmin property. Example: "printer.logLevel"- Specified by:
setIdin interfacePropertyMetaData- Returns:
- The Configuration Admin property name
-
setRequired
Description copied from interface:PropertyMetaDataTells if this property is required or not.- Specified by:
setRequiredin interfacePropertyMetaData
-
setType
Description copied from interface:PropertyMetaDataReturns the property primitive type. If must be either one of the following types:- String.class
- Long.class
- Integer.class
- Character.class
- Byte.class
- Double.class
- Float.class
- Boolean.class
- Specified by:
setTypein interfacePropertyMetaData
-
getOptionLabels
-
getOptionValues
-
getCardinality
public int getCardinality() -
getDefaults
-
getDescription
-
getHeading
-
getId
-
isRequired
public boolean isRequired() -
getType
public int getType() -
toString
-