public class AD extends OptionalAttributes
AD
class represents the AD
element of the
meta type descriptor.Modifier and Type | Field and Description |
---|---|
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_INVALID_VALUE
The message returned from the
validate(String) method if the
value is invalid considering its type (value is "%invalid value"). |
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_MISSING
The message returned from the
validate(String) method if the
value is null or cannot be converted to an attribute value and a value
is required (value is "%missing required value"). |
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 and Description |
---|
AD() |
Modifier and Type | Method and Description |
---|---|
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)
Sets the default value(s) for this AD.
|
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 validation result. |
addOptionalAttribute, getOptionalAttributes
public static final String VALIDATE_NOT_A_VALID_OPTION
validate(String)
method if the
value is not any of the specified option values
(value is "%not a valid option").public static final String VALIDATE_INVALID_VALUE
validate(String)
method if the
value is invalid considering its type (value is "%invalid value").public static final String VALIDATE_GREATER_THAN_MAXIMUM
validate(String)
method if the
value is greater than the specified maximum value
(value is "%greater than maximum").public static final String VALIDATE_LESS_THAN_MINIMUM
validate(String)
method if the
value is less than the specified minimum value
(value is "%less than minimum").public static final String VALIDATE_MISSING
validate(String)
method if the
value is null or cannot be converted to an attribute value and a value
is required
(value is "%missing required value").public String getID()
public String getName()
public String getDescription()
public int getType()
public int getCardinality()
public String[] getOptionLabels()
public String[] getOptionValues()
public String[] getDefaultValue()
public String getMin()
public String getMax()
public boolean isRequired()
public String validate(String valueString)
valueString
and returns an
indication of the validation result.valueString
- The string representation of the value to validate,
can be null
.null
if no validation is performed, "" if
the value is accepted as valid, or a non-empty string
indicating a validation problem was found.ADValidator.validate(AD, String)
,
VALIDATE_GREATER_THAN_MAXIMUM
,
VALIDATE_NOT_A_VALID_OPTION
,
VALIDATE_LESS_THAN_MINIMUM
,
VALIDATE_INVALID_VALUE
,
VALIDATE_MISSING
public void setID(String id)
id
- the id to setpublic void setName(String name)
name
- the name to setpublic void setDescription(String description)
description
- the description to setpublic void setType(String typeString)
typeString
- the type to setpublic void setCardinality(int cardinality)
cardinality
- the cardinality to setpublic void setOptions(Map options)
options
- the options to setpublic void setDefaultValue(String defaultValue)
NOTE: this method is depending on the value of getCardinality()
! Make sure that the
cardinality is properly set before calling this method.
defaultValue
- the default value to set, as encoded string-value (using comma's as separator), can be null
.public void setMin(String min)
min
- the min to setpublic void setMax(String max)
max
- the max to setpublic void setRequired(boolean isRequired)
isRequired
- the isRequired to setpublic static int toType(String typeString)
Copyright © 2010 - 2020 Adobe. All Rights Reserved