T - public class MetadataField<T> extends JSONObject
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_VALUE |
static java.lang.String |
EXTERNAL_ID |
static java.lang.String |
LABEL |
static java.lang.String |
MANDATORY |
static java.lang.String |
TYPE |
static java.lang.String |
VALIDATION |
NULL| Constructor and Description |
|---|
MetadataField(MetadataFieldType type) |
MetadataField(java.lang.String type) |
| Modifier and Type | Method and Description |
|---|---|
MetadataDataSource |
getDataSource()
Get the data source definition of this field.
|
T |
getDefaultValue()
Gets the default value of this field.
|
java.lang.String |
getExternalId()
Get the id of the field.
|
java.lang.String |
getLabel()
Get the label of the field
|
MetadataFieldType |
getType()
The type of the field.
|
MetadataValidation |
getValidation()
Get the validation rules of this field.
|
boolean |
isMandatory()
Cehcks whether the field is mandatory.
|
void |
setDataSource(MetadataDataSource dataSource)
Set the datasource for the field.
|
void |
setDefaultValue(T defaultValue)
Set the default value of the field
|
void |
setExternalId(java.lang.String externalId)
Set the id of the string (auto-generated if this is left blank).
|
void |
setLabel(java.lang.String label)
Sets the label of the field
|
void |
setMandatory(java.lang.Boolean mandatory)
Sets a boolean indicating whether this fields needs to be mandatory.
|
void |
setValidation(MetadataValidation validation)
Set the validation rules of this field.
|
accumulate, append, doubleToString, get, getBoolean, getDouble, getInt, getJSONArray, getJSONObject, getLong, getNames, getNames, getString, has, increment, isNull, keys, keySet, length, names, numberToString, opt, optBoolean, optBoolean, optDouble, optDouble, optInt, optInt, optJSONArray, optJSONObject, optLong, optLong, optString, optString, put, put, put, put, put, put, put, putOnce, putOpt, quote, quote, remove, similar, stringToValue, testValidity, toJSONArray, toString, toString, valueToString, wrap, writepublic static final java.lang.String DEFAULT_VALUE
public static final java.lang.String EXTERNAL_ID
public static final java.lang.String LABEL
public static final java.lang.String MANDATORY
public static final java.lang.String TYPE
public static final java.lang.String VALIDATION
public MetadataField(MetadataFieldType type)
public MetadataField(java.lang.String type)
public MetadataFieldType getType()
public java.lang.String getExternalId()
public void setExternalId(java.lang.String externalId)
externalId - The id to set.public java.lang.String getLabel()
public void setLabel(java.lang.String label)
label - The label to set.public boolean isMandatory()
public void setMandatory(java.lang.Boolean mandatory)
mandatory - The boolean to set.public T getDefaultValue() throws java.text.ParseException
java.text.ParseException - If the stored value can't be parsed to the correct type.public void setDefaultValue(T defaultValue)
defaultValue - The value to set.public MetadataValidation getValidation()
public void setValidation(MetadataValidation validation)
validation - The rules to set.public MetadataDataSource getDataSource()
public void setDataSource(MetadataDataSource dataSource)
dataSource - The datasource to set.