public interface DynField extends Cloneable
DynObject
.
A field will be persisted only if it is set as persistent (@see
isPersistent()
, which is the default value.
Modifier and Type | Field and Description |
---|---|
static int |
ANY
Deprecated.
now autodetect the mode of use
|
static int |
CHOICE
Deprecated.
usado automaticamente al asignar AvailableValues
|
static int |
RANGE
Deprecated.
usado automaticamente al asignar minValue/maxValue
|
static int |
RELATION_TYPE_AGGREGATE
Relation of aggregation 1:N
|
static int |
RELATION_TYPE_COLLABORATION
Relation of colaboration 1:1 Two separate entities that are related
|
static int |
RELATION_TYPE_COMPOSITION
Relation of composition 1:N
|
static int |
RELATION_TYPE_IDENTITY
Relation of composition 1:1 both elements make the same entity
|
static int |
RELATION_TYPE_NONE |
Modifier and Type | Method and Description |
---|---|
Object |
coerce(Object value)
Force the type of value to the type of the field.
|
DynObjectValueItem[] |
getAvailableValues()
Return the available values for this field.
|
Class |
getClassOfItems()
If the field is a container (List, Map or Set) return the java class of
its items.
|
Class |
getClassOfValue()
Return the java class of the value of the field.
|
DataType |
getDataType() |
Object |
getDefaultValue()
Return the default value used in creation of new objects with this field.
|
String |
getDescription()
Return the descripcion associated to this field.
|
DynField |
getElementsType()
When a field is of type container, this method return a DynClass that
define the type of elements.
|
String |
getGroup()
Return a string that identify a group for this field.
|
Object |
getMaxValue() |
Object |
getMinValue() |
String |
getName()
Return the name of the field.
|
int |
getOder()
Return the ordinal that identify the order of this field in the
DynObject . |
String |
getSubtype()
Return the subtype associated to this field.
|
int |
getTheTypeOfAvailableValues()
Deprecated.
don't use, check minValue/maxValue and getAvailableValues
instead
|
int |
getType()
Return the type used in this field.
|
boolean |
isContainer()
Return true if the value of this field is a container.
|
boolean |
isHidden()
Inform if this field can be visible or not for the user.
|
boolean |
isMandatory()
Return true if this field is mandatory.
|
boolean |
isPersistent()
Returns if the field is persistent or volatile.
|
boolean |
isReadOnly()
Returns if the field is readOnly or not.
|
DynField |
setAvailableValues(DynObjectValueItem[] values) |
DynField |
setAvailableValues(List values) |
DynField |
setClassOfItems(Class theClass)
If field type is List, Set or Map, this class is the class of items.
|
DynField |
setClassOfValue(Class theClass)
Sets the class used for the values of the field.
|
DynField |
setDefaultDynValue(Object defaultValue)
Deprecated.
use instead
setDefaultFieldValue(Object) |
DynField |
setDefaultFieldValue(Object defaultValue)
Set the default value used for this field when a new object with this
field is created.
|
DynField |
setDescription(String description)
Sets the description asociated to this field.
|
DynField |
setElementsType(DynStruct type)
Set the type of items when the field is a container.
|
DynField |
setElementsType(int type)
Set the type of items when the field is a container.
|
DynField |
setGroup(String groupName) |
DynField |
setHidden(boolean hidden) |
DynField |
setMandatory(boolean mandatory) |
DynField |
setMaxValue(Object maxValue) |
DynField |
setMinValue(Object minValue) |
DynField |
setOrder(int order) |
DynField |
setPersistent(boolean persistent)
Sets if the field must be persisted or not.
|
DynField |
setReadOnly(boolean isReadOnly)
Sets if the field is readOnly or not.
|
DynField |
setSubtype(String subtype)
Strings used as subtype for this field.
|
DynField |
setTheTypeOfAvailableValues(int type)
Deprecated.
don't use, set minValue/maxValue and availableValues instead
|
DynField |
setType(DataType type) |
DynField |
setType(int type)
Sets the type of the field.
|
void |
validate(Object value)
Validate that the value match the properties of the field.
|
static final int RELATION_TYPE_NONE
static final int RELATION_TYPE_COLLABORATION
static final int RELATION_TYPE_IDENTITY
static final int RELATION_TYPE_COMPOSITION
static final int RELATION_TYPE_AGGREGATE
static final int ANY
static final int CHOICE
static final int RANGE
String getName()
int getType()
DataTypes
DataType getDataType()
String getSubtype()
DataTypes.DYNOBJECT
, the subtype are
the fullname of the DynClass.String getDescription()
Object getDefaultValue()
String getGroup()
int getOder()
DynObject
.DynObject
boolean isMandatory()
boolean isPersistent()
boolean isHidden()
boolean isReadOnly()
boolean isContainer()
DataType
DynObjectValueItem[] getAvailableValues()
Object getMinValue()
Object getMaxValue()
Class getClassOfValue()
Class getClassOfItems()
DynField setDescription(String description)
description
- DynField
objectDynField setType(int type)
DataTypes
.
This method assign the default values of the type for "ClassOfValue" and
"subType".type
- DynField
objectDynField setSubtype(String subtype)
DataTypes.DYNOBJECT
, the subtype is the
fullname of the DynStruct.subtype
- DynField
objectDynField setDefaultFieldValue(Object defaultValue)
defaultValue
- DynField
objectDynField setOrder(int order)
DynField setMandatory(boolean mandatory)
DynField setHidden(boolean hidden)
DynField setPersistent(boolean persistent)
persistent
- if the field must be persisted or notDynField
objectisPersistent()
DynField setAvailableValues(DynObjectValueItem[] values)
DynField setClassOfValue(Class theClass) throws DynFieldIsNotAContainerException
theClass
- DynField
objectDynFieldIsNotAContainerException
DynField setClassOfItems(Class theClass) throws DynFieldIsNotAContainerException
theClass
- DynField
objectDynFieldIsNotAContainerException
DynField setReadOnly(boolean isReadOnly)
isReadOnly
- if the graphic component associated to this field
should be readOnly or notDynField getElementsType()
DynField setElementsType(int type) throws DynFieldIsNotAContainerException
type
- de los elementosDynField
objectDynFieldIsNotAContainerException
DynField setElementsType(DynStruct type) throws DynFieldIsNotAContainerException
type
- de los elementosDynField
objectDynFieldIsNotAContainerException
void validate(Object value) throws DynFieldValidateException
value
- DynFieldValidateException
Object coerce(Object value) throws CoercionException
value
- CoercionException
int getTheTypeOfAvailableValues()
DynField setDefaultDynValue(Object defaultValue)
setDefaultFieldValue(Object)
defaultValue
- DynField setTheTypeOfAvailableValues(int type)
type
-