Package org.apache.felix.metatype
Class AD
- java.lang.Object
-
- org.apache.felix.metatype.OptionalAttributes
-
- org.apache.felix.metatype.AD
-
@Deprecated(since="2021-05-27") public class AD extends OptionalAttributes
Deprecated.The Apache Felix metatype API is deprecated, please use the OSGi metatype API instead.TheADclass represents theADelement of the meta type descriptor.
-
-
Field Summary
Fields Modifier and Type Field Description static StringVALIDATE_GREATER_THAN_MAXIMUMDeprecated.The message returned from thevalidate(String)method if the value is greater than the specifiedmaximum value(value is "%greater than maximum").static StringVALIDATE_INVALID_VALUEDeprecated.The message returned from thevalidate(String)method if the value is invalid considering its type (value is "%invalid value").static StringVALIDATE_LESS_THAN_MINIMUMDeprecated.The message returned from thevalidate(String)method if the value is less than the specifiedminimum value(value is "%less than minimum").static StringVALIDATE_MISSINGDeprecated.The message returned from thevalidate(String)method if the value is null or cannot be converted to an attribute value and a value isrequired(value is "%missing required value").static StringVALIDATE_NOT_A_VALID_OPTIONDeprecated.The message returned from thevalidate(String)method if the value is not any of the specifiedoption values(value is "%not a valid option").
-
Constructor Summary
Constructors Constructor Description AD()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetCardinality()Deprecated.String[]getDefaultValue()Deprecated.StringgetDescription()Deprecated.StringgetID()Deprecated.StringgetMax()Deprecated.StringgetMin()Deprecated.StringgetName()Deprecated.String[]getOptionLabels()Deprecated.String[]getOptionValues()Deprecated.intgetType()Deprecated.booleanisRequired()Deprecated.voidsetCardinality(int cardinality)Deprecated.voidsetDefaultValue(String defaultValue)Deprecated.Sets the default value(s) for this AD.voidsetDescription(String description)Deprecated.voidsetID(String id)Deprecated.voidsetMax(String max)Deprecated.voidsetMin(String min)Deprecated.voidsetName(String name)Deprecated.voidsetOptions(Map options)Deprecated.voidsetRequired(boolean isRequired)Deprecated.voidsetType(String typeString)Deprecated.static String[]splitList(String listString)Deprecated.static inttoType(String typeString)Deprecated.Stringvalidate(String valueString)Deprecated.Implements validation of thevalueStringand returns an indication of the validation result.-
Methods inherited from class org.apache.felix.metatype.OptionalAttributes
addOptionalAttribute, getOptionalAttributes
-
-
-
-
Field Detail
-
VALIDATE_NOT_A_VALID_OPTION
public static final String VALIDATE_NOT_A_VALID_OPTION
Deprecated.The message returned from thevalidate(String)method if the value is not any of the specifiedoption values(value is "%not a valid option").- See Also:
- Constant Field Values
-
VALIDATE_INVALID_VALUE
public static final String VALIDATE_INVALID_VALUE
Deprecated.The message returned from thevalidate(String)method if the value is invalid considering its type (value is "%invalid value").- See Also:
- Constant Field Values
-
VALIDATE_GREATER_THAN_MAXIMUM
public static final String VALIDATE_GREATER_THAN_MAXIMUM
Deprecated.The message returned from thevalidate(String)method if the value is greater than the specifiedmaximum value(value is "%greater than maximum").- See Also:
- Constant Field Values
-
VALIDATE_LESS_THAN_MINIMUM
public static final String VALIDATE_LESS_THAN_MINIMUM
Deprecated.The message returned from thevalidate(String)method if the value is less than the specifiedminimum value(value is "%less than minimum").- See Also:
- Constant Field Values
-
VALIDATE_MISSING
public static final String VALIDATE_MISSING
Deprecated.The message returned from thevalidate(String)method if the value is null or cannot be converted to an attribute value and a value isrequired(value is "%missing required value").- See Also:
- Constant Field Values
-
-
Method Detail
-
getID
public String getID()
Deprecated.
-
getName
public String getName()
Deprecated.
-
getDescription
public String getDescription()
Deprecated.
-
getType
public int getType()
Deprecated.
-
getCardinality
public int getCardinality()
Deprecated.
-
getOptionLabels
public String[] getOptionLabels()
Deprecated.
-
getOptionValues
public String[] getOptionValues()
Deprecated.
-
getDefaultValue
public String[] getDefaultValue()
Deprecated.
-
getMin
public String getMin()
Deprecated.
-
getMax
public String getMax()
Deprecated.
-
isRequired
public boolean isRequired()
Deprecated.
-
validate
public String validate(String valueString)
Deprecated.Implements validation of thevalueStringand returns an indication of the validation result.- Parameters:
valueString- The string representation of the value to validate, can benull.- Returns:
nullif no validation is performed, "" if the value is accepted as valid, or a non-empty string indicating a validation problem was found.- See Also:
ADValidator.validate(AD, String),VALIDATE_GREATER_THAN_MAXIMUM,VALIDATE_NOT_A_VALID_OPTION,VALIDATE_LESS_THAN_MINIMUM,VALIDATE_INVALID_VALUE,VALIDATE_MISSING
-
setID
public void setID(String id)
Deprecated.- Parameters:
id- the id to set
-
setName
public void setName(String name)
Deprecated.- Parameters:
name- the name to set
-
setDescription
public void setDescription(String description)
Deprecated.- Parameters:
description- the description to set
-
setType
public void setType(String typeString)
Deprecated.- Parameters:
typeString- the type to set
-
setCardinality
public void setCardinality(int cardinality)
Deprecated.- Parameters:
cardinality- the cardinality to set
-
setOptions
public void setOptions(Map options)
Deprecated.- Parameters:
options- the options to set
-
setDefaultValue
public void setDefaultValue(String defaultValue)
Deprecated.Sets the default value(s) for this AD.NOTE: this method is depending on the value of
getCardinality()! Make sure that the cardinality is properly set before calling this method.- Parameters:
defaultValue- the default value to set, as encoded string-value (using comma's as separator), can benull.
-
setMin
public void setMin(String min)
Deprecated.- Parameters:
min- the min to set
-
setMax
public void setMax(String max)
Deprecated.- Parameters:
max- the max to set
-
setRequired
public void setRequired(boolean isRequired)
Deprecated.- Parameters:
isRequired- the isRequired to set
-
toType
public static int toType(String typeString)
Deprecated.
-
-