org.apache.felix.dm
Interface PropertyMetaData

All Known Implementing Classes:
PropertyMetaDataImpl

public interface PropertyMetaData

This interface defines meta data regarding a given configuration property.


Method Summary
 PropertyMetaData addOption(String optionLabel, String optionValue)
          Return a list of valid options for this property (the labels may be localized).
 PropertyMetaData setCardinality(int cardinality)
          Return the cardinality of this property.
 PropertyMetaData setDefaults(String[] defaults)
          Returns a default for this property.
 PropertyMetaData setDescription(String description)
          Returns the property description.
 PropertyMetaData setHeading(String heading)
          The label used to display the property.
 PropertyMetaData setId(String id)
          The key of a ConfigurationAdmin property.
 PropertyMetaData setRequired(boolean required)
          Tells if this property is required or not.
 PropertyMetaData setType(Class type)
          Returns the property primitive type.
 

Method Detail

setHeading

PropertyMetaData setHeading(String heading)
The label used to display the property. Example: "Log Level".

Returns:
The label used to display the property (may be localized)

setId

PropertyMetaData setId(String id)
The key of a ConfigurationAdmin property. Example: "printer.logLevel"

Returns:
The Configuration Admin property name

setType

PropertyMetaData setType(Class type)
Returns the property primitive type. If must be either one of the following types:


setDefaults

PropertyMetaData setDefaults(String[] defaults)
Returns 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.


setDescription

PropertyMetaData setDescription(String description)
Returns 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".

Returns:
a localizable description of the property.

setCardinality

PropertyMetaData setCardinality(int cardinality)
Return 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:


setRequired

PropertyMetaData setRequired(boolean required)
Tells if this property is required or not.


addOption

PropertyMetaData addOption(String optionLabel,
                           String optionValue)
Return a list of valid options for this property (the labels may be localized).

Returns:
the list of valid options for this property.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.