Class PropertyMetaDataImpl

java.lang.Object
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.
Author:
Felix Project Team
  • Constructor Details

    • PropertyMetaDataImpl

      public PropertyMetaDataImpl()
  • Method Details

    • 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:

      • 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:
      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:

      • String.class
      • Long.class
      • Integer.class
      • Character.class
      • Byte.class
      • Double.class
      • Float.class
      • Boolean.class
      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