org.apache.felix.metatype
Class AD

java.lang.Object
  extended by org.apache.felix.metatype.AD

public class AD
extends Object

The AD class represents the AD element of the meta type descriptor.

Author:
fmeschbe

Field Summary
static String VALIDATE_GREATER_THAN_MAXIMUM
          The message returned from the validate(String) method if the value is greater than the specified maximum value (value is "%greater than maximum").
static String VALIDATE_LESS_THAN_MINIMUM
          The message returned from the validate(String) method if the value is less than the specified minimum value (value is "%less than minimum").
static String VALIDATE_NOT_A_VALID_OPTION
          The message returned from the validate(String) method if the value is not any of the specified option values (value is "%not a valid option").
 
Constructor Summary
AD()
           
 
Method Summary
protected  Comparable convertToType(String value)
           
 int getCardinality()
           
 String[] getDefaultValue()
           
 String getDescription()
           
 String getID()
           
 String getMax()
           
 String getMin()
           
 String getName()
           
 String[] getOptionLabels()
           
 String[] getOptionValues()
           
 int getType()
           
 boolean isRequired()
           
 void setCardinality(int cardinality)
           
 void setDefaultValue(String defaultValue)
           
 void setDefaultValue(String[] defaultValue)
           
 void setDescription(String description)
           
 void setID(String id)
           
 void setMax(String max)
           
 void setMin(String min)
           
 void setName(String name)
           
 void setOptions(Map options)
           
 void setRequired(boolean isRequired)
           
 void setType(String typeString)
           
static String[] splitList(String listString)
           
static int toType(String typeString)
           
 String validate(String valueString)
          Implements validation of the valueString and returns an indication of the success: null If neither a minimal value nor a maximal value nor any optional values are defined in this instance, validation cannot be performed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATE_NOT_A_VALID_OPTION

public static final String VALIDATE_NOT_A_VALID_OPTION
The message returned from the validate(String) method if the value is not any of the specified option values (value is "%not a valid option").

See Also:
Constant Field Values

VALIDATE_GREATER_THAN_MAXIMUM

public static final String VALIDATE_GREATER_THAN_MAXIMUM
The message returned from the validate(String) method if the value is greater than the specified maximum value (value is "%greater than maximum").

See Also:
Constant Field Values

VALIDATE_LESS_THAN_MINIMUM

public static final String VALIDATE_LESS_THAN_MINIMUM
The message returned from the validate(String) method if the value is less than the specified minimum value (value is "%less than minimum").

See Also:
Constant Field Values
Constructor Detail

AD

public AD()
Method Detail

getID

public String getID()

getName

public String getName()

getDescription

public String getDescription()

getType

public int getType()

getCardinality

public int getCardinality()

getOptionLabels

public String[] getOptionLabels()

getOptionValues

public String[] getOptionValues()

getDefaultValue

public String[] getDefaultValue()

getMin

public String getMin()

getMax

public String getMax()

isRequired

public boolean isRequired()

validate

public String validate(String valueString)
Implements validation of the valueString and returns an indication of the success:
null
If neither a minimal value nor a maximal value nor any optional values are defined in this instance, validation cannot be performed.
Empty String
If validation succeeds. This value is also returned if the valueString is empty or null or cannot be converted into a numeric type.
%message
If the value falls below the minimum, higher than the maximum or is not any of the option values, an explanatory message, which may be localized is returned. If any of the minimum, maximum or option values is null, the respective value is not checked.

Parameters:
valueString - The string representation of the value to validate.
Returns:
As explained above.
See Also:
VALIDATE_GREATER_THAN_MAXIMUM, VALIDATE_LESS_THAN_MINIMUM, VALIDATE_NOT_A_VALID_OPTION

setID

public void setID(String id)
Parameters:
id - the id to set

setName

public void setName(String name)
Parameters:
name - the name to set

setDescription

public void setDescription(String description)
Parameters:
description - the description to set

setType

public void setType(String typeString)
Parameters:
typeString - the type to set

setCardinality

public void setCardinality(int cardinality)
Parameters:
cardinality - the cardinality to set

setOptions

public void setOptions(Map options)
Parameters:
options - the options to set

setDefaultValue

public void setDefaultValue(String defaultValue)
Parameters:
defaultValue - the defaultValue to set

setMin

public void setMin(String min)
Parameters:
min - the min to set

setMax

public void setMax(String max)
Parameters:
max - the max to set

setDefaultValue

public void setDefaultValue(String[] defaultValue)
Parameters:
defaultValue - the defaultValue to set

setRequired

public void setRequired(boolean isRequired)
Parameters:
isRequired - the isRequired to set

toType

public static int toType(String typeString)

splitList

public static String[] splitList(String listString)

convertToType

protected Comparable convertToType(String value)


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.