org.apache.felix.dm.impl.metatype
Class PropertyMetaDataImpl

java.lang.Object
  extended by org.apache.felix.dm.impl.metatype.PropertyMetaDataImpl
All Implemented Interfaces:
PropertyMetaData

public class PropertyMetaDataImpl
extends Object
implements PropertyMetaData

DependencyManager PropertyMetaData Implementation. This class describes meta informations regarding one given configuration property.


Constructor Summary
PropertyMetaDataImpl()
           
 
Method Summary
 PropertyMetaData addOption(String optionLabel, String optionValue)
          Return a list of valid options for this property (the labels may be localized).
 int getCardinality()
           
 String[] getDefaults()
           
 String getDescription()
           
 String getHeading()
           
 String getId()
           
 String[] getOptionLabels()
           
 String[] getOptionValues()
           
 int getType()
           
 boolean isRequired()
           
 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 classType)
          Returns the property primitive type.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyMetaDataImpl

public PropertyMetaDataImpl()
Method Detail

addOption

public PropertyMetaData addOption(String optionLabel,
                                  String optionValue)
Description copied from interface: PropertyMetaData
Return a list of valid options for this property (the labels may be localized).

Specified by:
addOption in interface PropertyMetaData
Returns:
the list of valid options for this property.

setCardinality

public PropertyMetaData setCardinality(int cardinality)
Description copied from interface: PropertyMetaData
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:

Specified by:
setCardinality in interface PropertyMetaData

setDefaults

public PropertyMetaData setDefaults(String[] defaults)
Description copied from interface: PropertyMetaData
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.

Specified by:
setDefaults in interface PropertyMetaData

setDescription

public PropertyMetaData setDescription(String description)
Description copied from interface: PropertyMetaData
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".

Specified by:
setDescription in interface PropertyMetaData
Returns:
a localizable description of the property.

setHeading

public PropertyMetaData setHeading(String heading)
Description copied from interface: PropertyMetaData
The label used to display the property. Example: "Log Level".

Specified by:
setHeading in interface PropertyMetaData
Returns:
The label used to display the property (may be localized)

setId

public PropertyMetaData setId(String id)
Description copied from interface: PropertyMetaData
The key of a ConfigurationAdmin property. Example: "printer.logLevel"

Specified by:
setId in interface PropertyMetaData
Returns:
The Configuration Admin property name

setRequired

public PropertyMetaData setRequired(boolean required)
Description copied from interface: PropertyMetaData
Tells if this property is required or not.

Specified by:
setRequired in interface PropertyMetaData

setType

public PropertyMetaData setType(Class classType)
Description copied from interface: PropertyMetaData
Returns the property primitive type. If must be either one of the following types:

Specified by:
setType in interface PropertyMetaData

getOptionLabels

public String[] getOptionLabels()

getOptionValues

public String[] getOptionValues()

getCardinality

public int getCardinality()

getDefaults

public String[] getDefaults()

getDescription

public String getDescription()

getHeading

public String getHeading()

getId

public String getId()

isRequired

public boolean isRequired()

getType

public int getType()

toString

public String toString()
Overrides:
toString in class Object


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