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 without composition
|
static int |
RELATION_TYPE_AGGREGATE_WITH_COMPOSITION
Relation of aggregation 1:N with composition
|
static int |
RELATION_TYPE_COLLABORATION
Relation of colaboration 1:1 without composition.
|
static int |
RELATION_TYPE_COLLABORATION_WITH_COMPOSITION
Relation of colaboration 1:1 with composition.
|
static int |
RELATION_TYPE_COMPOSITION
Deprecated.
use RELATION_TYPE_AGGREGATE_WITH_COMPOSITION
|
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 |
---|---|
java.lang.Object |
coerce(java.lang.Object value)
Force the type of value to the type of the field.
|
DynObjectValueItem[] |
getAvailableValues()
Return the available values for this field.
|
java.lang.Class |
getClassOfItems()
If the field is a container (List, Map or Set) return the java class of
its items.
|
java.lang.Class |
getClassOfValue()
Return the java class of the value of the field.
|
DataType |
getDataType() |
java.lang.Object |
getDefaultValue()
Return the default value used in creation of new objects with this field.
|
java.lang.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.
|
java.lang.String |
getGroup()
Return a string that identify a group for this field.
|
java.lang.Object |
getMaxValue() |
java.lang.Object |
getMinValue() |
java.lang.String |
getName()
Return the name of the field.
|
int |
getOder()
Return the ordinal that identify the order of this field in the
DynObject . |
java.lang.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(java.util.List values) |
DynField |
setClassOfItems(java.lang.Class theClass)
If field type is List, Set or Map, this class is the class of items.
|
DynField |
setClassOfValue(java.lang.Class theClass)
Sets the class used for the values of the field.
|
DynField |
setDefaultDynValue(java.lang.Object defaultValue)
Deprecated.
use instead
setDefaultFieldValue(Object) |
DynField |
setDefaultFieldValue(java.lang.Object defaultValue)
Set the default value used for this field when a new object with this
field is created.
|
DynField |
setDescription(java.lang.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(java.lang.String groupName) |
DynField |
setHidden(boolean hidden) |
DynField |
setMandatory(boolean mandatory) |
DynField |
setMaxValue(java.lang.Object maxValue) |
DynField |
setMinValue(java.lang.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(java.lang.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(java.lang.Object value)
Validate that the value match the properties of the field.
|
clone, cloneQuietly, cloneQuietly
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_WITH_COMPOSITION
static final int RELATION_TYPE_AGGREGATE
static final int RELATION_TYPE_COLLABORATION_WITH_COMPOSITION
static final int ANY
static final int CHOICE
static final int RANGE
java.lang.String getName()
int getType()
DataTypes
DataType getDataType()
java.lang.String getSubtype()
DataTypes.DYNOBJECT
, the subtype are
the fullname of the DynClass.java.lang.String getDescription()
java.lang.Object getDefaultValue()
java.lang.String getGroup()
int getOder()
DynObject
.DynObject
boolean isMandatory()
boolean isPersistent()
boolean isHidden()
boolean isReadOnly()
boolean isContainer()
DataType
DynObjectValueItem[] getAvailableValues()
java.lang.Object getMinValue()
java.lang.Object getMaxValue()
java.lang.Class getClassOfValue()
java.lang.Class getClassOfItems()
DynField setDescription(java.lang.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(java.lang.String subtype)
DataTypes.DYNOBJECT
, the subtype is the
fullname of the DynStruct.subtype
- DynField
objectDynField setDefaultFieldValue(java.lang.Object defaultValue)
defaultValue
- DynField
objectDynField setGroup(java.lang.String groupName)
DynField 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 setAvailableValues(java.util.List values)
DynField setMinValue(java.lang.Object minValue)
DynField setMaxValue(java.lang.Object maxValue)
DynField setClassOfValue(java.lang.Class theClass) throws DynFieldIsNotAContainerException
theClass
- DynField
objectDynFieldIsNotAContainerException
DynField setClassOfItems(java.lang.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(java.lang.Object value) throws DynFieldValidateException
value
- DynFieldValidateException
java.lang.Object coerce(java.lang.Object value) throws CoercionException
value
- CoercionException
int getTheTypeOfAvailableValues()
DynField setDefaultDynValue(java.lang.Object defaultValue)
setDefaultFieldValue(Object)
defaultValue
- DynField setTheTypeOfAvailableValues(int type)
type
-