public class DefaultDynField extends java.lang.Object implements DynField_v2
DynField_v2.AvailableValuesProvider
Modifier and Type | Field and Description |
---|---|
static Logger |
log |
ANY, CHOICE, RANGE, RELATION_TYPE_AGGREGATE, RELATION_TYPE_AGGREGATE_WITH_COMPOSITION, RELATION_TYPE_COLLABORATION, RELATION_TYPE_COLLABORATION_WITH_COMPOSITION, RELATION_TYPE_COMPOSITION, RELATION_TYPE_IDENTITY, RELATION_TYPE_NONE
Modifier | Constructor and Description |
---|---|
|
DefaultDynField(java.lang.String name,
int dataType) |
protected |
DefaultDynField(java.lang.String name,
int dataType,
java.lang.Object defaultValue,
boolean persistent,
boolean mandatory) |
Modifier and Type | Method and Description |
---|---|
void |
check() |
java.lang.Object |
clone()
Creates a copy of the object.
|
java.lang.Object |
coerce(java.lang.Object value)
Force the type of value to the type of the field.
|
void |
copyFrom(DynField other) |
boolean |
equals(java.lang.Object obj) |
DynObjectValueItem[] |
getAvailableValues()
Return the available values for this field.
|
DynObjectValueItem[] |
getAvailableValues(DynObject context) |
DynMethod |
getAvailableValuesMethod() |
java.lang.Object |
getCalculatedValue(DynObject self) |
DynMethod |
getCalculateMethod() |
java.lang.String |
getClassNameOfItems()
When is a Container of objects field returns the name of class of the
elements, otherwise returns null
|
java.lang.String |
getClassNameOfValue()
When is a Object field returns the name of object's class, otherwise
returns null
|
java.lang.Class |
getClassOfItems()
When is a Container of objects field returns the class of the elements,
otherwise returns null
|
java.lang.Class |
getClassOfValue()
Return the java class of the value of the field.
|
java.lang.Object |
getCoercedDefaultValue() |
DataType |
getDataType() |
java.lang.Object |
getDefaultValue()
Return the default value used in creation of new objects with this field.
|
java.util.function.Supplier |
getDefaultValueSupplier() |
java.lang.String |
getDescription()
Return the descripcion associated to this field.
|
DynStruct |
getDynClassOfItems()
When is a Container of DynObjects field returns the DynStruct of the
elements, otherwise returns null
|
DynStruct |
getDynClassOfValue()
When is a DynObject field returns the DynStruct of the DynObject,
otherwise returns null
|
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.String |
getLabel() |
java.lang.String |
getLocalizedLabel() |
java.lang.String |
getLocalizedShortLabel() |
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 . |
int |
getRelationType() |
java.lang.String |
getShortLabel() |
java.lang.String |
getSubtype()
Return the subtype associated to this field.
|
Tags |
getTags() |
int |
getTheTypeOfAvailableValues() |
int |
getType()
Return the type used in this field.
|
int |
getTypeOfItems()
When is a Container field returns the type of the elements, otherwise
returns INVALID
|
boolean |
getValidateElements() |
protected ValueType |
getValueType() |
boolean |
isAvailableValuesCalculated() |
boolean |
isCalculated() |
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(DynMethod computeAvailableValues) |
DynField |
setAvailableValues(DynObjectValueItem[] availableValues) |
DynField |
setAvailableValues(java.util.List availableValues) |
DynField |
setCalculateMethod(DynMethod method) |
DynField |
setClassOfItems(java.lang.Class theClass)
If field type is List, Set or Map, this class is the class of items.
|
DynField |
setClassOfItems(DynStruct dynStrct) |
DynField |
setClassOfItems(java.lang.String theClassNameOfValue) |
DynField |
setClassOfValue(java.lang.Class theClass)
Sets the class used for the values of the field.
|
DynField |
setClassOfValue(DynStruct dynStruct) |
DynField |
setClassOfValue(java.lang.String theClassName) |
DynField |
setDefaultDynValue(java.lang.Object defaultValue) |
DynField |
setDefaultFieldValue(java.lang.Object defaultValue)
Set the default value used for this field when a new object with this
field is created.
|
DynField |
setDefaultValueSupplier(java.util.function.Supplier supplier) |
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 |
setLabel(java.lang.String label) |
DynField |
setMandatory(boolean mandatory) |
DynField |
setMaxValue(java.lang.Object maxValue) |
DynField |
setMinValue(java.lang.Object minValue) |
DynField |
setName(java.lang.String name) |
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 |
setRelationType(int relationType) |
DynField |
setShortLabel(java.lang.String shortLabel) |
DynField |
setSubtype(java.lang.String subtype)
Strings used as subtype for this field.
|
DynField |
setTheTypeOfAvailableValues(int type) |
DynField |
setType(DataType dataType) |
DynField |
setType(int dataType)
Sets the type of the field.
|
DynField |
setTypeOfItems(int type) |
DynField |
setValidateElements(boolean validate) |
java.lang.String |
toString() |
void |
validate(java.lang.Object value)
Validate that the value match the properties of the field.
|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
cloneQuietly, cloneQuietly
public DefaultDynField(java.lang.String name, int dataType)
protected DefaultDynField(java.lang.String name, int dataType, java.lang.Object defaultValue, boolean persistent, boolean mandatory)
public void copyFrom(DynField other)
copyFrom
in interface DynField_v2
protected ValueType getValueType()
public DynField setCalculateMethod(DynMethod method)
setCalculateMethod
in interface DynField_v2
public DynMethod getCalculateMethod()
getCalculateMethod
in interface DynField_v2
public boolean isCalculated()
isCalculated
in interface DynField_v2
public java.lang.Object getCalculatedValue(DynObject self)
getCalculatedValue
in interface DynField_v2
public void check() throws ListBaseException
ListBaseException
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
DynField
public DynField setName(java.lang.String name)
public DynField setDescription(java.lang.String description)
DynField
setDescription
in interface DynField
DynField
objectpublic java.lang.String getDescription()
DynField
getDescription
in interface DynField
public DynField setLabel(java.lang.String label)
setLabel
in interface DynField_LabelAttribute
public java.lang.String getLabel()
getLabel
in interface DynField_LabelAttribute
public java.lang.String getLocalizedLabel()
getLocalizedLabel
in interface DynField_LabelAttribute
public DynField setShortLabel(java.lang.String shortLabel)
setShortLabel
in interface DynField_LabelAttribute
public java.lang.String getShortLabel()
getShortLabel
in interface DynField_LabelAttribute
public java.lang.String getLocalizedShortLabel()
getLocalizedShortLabel
in interface DynField_LabelAttribute
public DynField setType(int dataType)
DynField
DataTypes
.
This method assign the default values of the type for "ClassOfValue" and
"subType".public int getType()
DynField
DataTypes
public DataType getDataType()
getDataType
in interface DynField
public DynField setSubtype(java.lang.String subtype)
DynField
DataTypes.DYNOBJECT
, the subtype is the
fullname of the DynStruct.setSubtype
in interface DynField
DynField
objectpublic java.lang.String getSubtype()
DynField
DataTypes.DYNOBJECT
, the subtype are
the fullname of the DynClass.getSubtype
in interface DynField
public DynField setDefaultDynValue(java.lang.Object defaultValue)
setDefaultDynValue
in interface DynField
public java.lang.Object getDefaultValue()
DynField
getDefaultValue
in interface DynField
public java.lang.Object getCoercedDefaultValue()
getCoercedDefaultValue
in interface DynField_v2
public boolean isAvailableValuesCalculated()
isAvailableValuesCalculated
in interface DynField_v2
public DynField setAvailableValues(DynObjectValueItem[] availableValues)
setAvailableValues
in interface DynField
public DynField setAvailableValues(java.util.List availableValues)
setAvailableValues
in interface DynField
public DynField setAvailableValues(DynMethod computeAvailableValues)
setAvailableValues
in interface DynField_v2
public DynMethod getAvailableValuesMethod()
getAvailableValuesMethod
in interface DynField_v2
public DynObjectValueItem[] getAvailableValues()
DynField
getAvailableValues
in interface DynField
public DynObjectValueItem[] getAvailableValues(DynObject context)
getAvailableValues
in interface DynField_v2
public DynField setMinValue(java.lang.Object minValue)
setMinValue
in interface DynField
public java.lang.Object getMinValue()
getMinValue
in interface DynField
public DynField setMaxValue(java.lang.Object maxValue)
setMaxValue
in interface DynField
public java.lang.Object getMaxValue()
getMaxValue
in interface DynField
public boolean isMandatory()
DynField
isMandatory
in interface DynField
public boolean isPersistent()
DynField
isPersistent
in interface DynField
public DynField setMandatory(boolean mandatory)
setMandatory
in interface DynField
public DynField setPersistent(boolean persistent)
DynField
setPersistent
in interface DynField
persistent
- if the field must be persisted or notDynField
objectDynField.isPersistent()
public DynField setTheTypeOfAvailableValues(int type)
setTheTypeOfAvailableValues
in interface DynField
public int getTheTypeOfAvailableValues()
getTheTypeOfAvailableValues
in interface DynField
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- public java.lang.Class getClassOfValue()
DynField
getClassOfValue
in interface DynField
public DynField setClassOfValue(java.lang.Class theClass)
DynField
setClassOfValue
in interface DynField
DynField
objectpublic DynField setClassOfValue(java.lang.String theClassName)
setClassOfValue
in interface DynField_v2
public boolean isContainer()
DynField
DataType
isContainer
in interface DynField
public void validate(java.lang.Object value) throws DynFieldValidateException
DynField
validate
in interface DynField
DynFieldValidateException
public java.util.function.Supplier getDefaultValueSupplier()
getDefaultValueSupplier
in interface DynField_v2
public DynField setDefaultValueSupplier(java.util.function.Supplier supplier)
setDefaultValueSupplier
in interface DynField_v2
public java.lang.Object coerce(java.lang.Object value) throws CoercionException
DynField
coerce
in interface DynField
CoercionException
public java.lang.String getGroup()
DynField
public DynField setGroup(java.lang.String groupName)
public int getOder()
DynField
DynObject
.public boolean isHidden()
DynField
public boolean isReadOnly()
DynField
isReadOnly
in interface DynField
public DynField setReadOnly(boolean isReadOnly)
DynField
setReadOnly
in interface DynField
isReadOnly
- if the graphic component associated to this field
should be readOnly or notpublic DynField setDefaultFieldValue(java.lang.Object defaultValue)
DynField
setDefaultFieldValue
in interface DynField
DynField
objectpublic Tags getTags()
getTags
in interface DynField_v2
getTags
in interface Tagged
public java.lang.String getClassNameOfValue()
DynField_v2
getClassNameOfValue
in interface DynField_v2
public DynField setClassOfValue(DynStruct dynStruct)
setClassOfValue
in interface DynField_v2
public DynStruct getDynClassOfValue()
DynField_v2
getDynClassOfValue
in interface DynField_v2
public int getRelationType()
getRelationType
in interface DynField_v2
public DynField setRelationType(int relationType)
setRelationType
in interface DynField_v2
public DynField setElementsType(int type)
DynField
setElementsType
in interface DynField
type
- de los elementosDynField
objectpublic DynField setElementsType(DynStruct type)
DynField
setElementsType
in interface DynField
type
- de los elementosDynField
objectpublic DynField getElementsType()
DynField
getElementsType
in interface DynField
public DynField setClassOfItems(DynStruct dynStrct)
setClassOfItems
in interface DynField_v2
public DynField setClassOfItems(java.lang.String theClassNameOfValue)
setClassOfItems
in interface DynField_v2
public java.lang.String getClassNameOfItems()
DynField_v2
getClassNameOfItems
in interface DynField_v2
public DynStruct getDynClassOfItems()
DynField_v2
getDynClassOfItems
in interface DynField_v2
public DynField setClassOfItems(java.lang.Class theClass) throws DynFieldIsNotAContainerException
DynField
setClassOfItems
in interface DynField
setClassOfItems
in interface DynField_v2
DynField
objectDynFieldIsNotAContainerException
public java.lang.Class getClassOfItems()
DynField_v2
getClassOfItems
in interface DynField
getClassOfItems
in interface DynField_v2
public DynField setTypeOfItems(int type)
setTypeOfItems
in interface DynField_v2
public int getTypeOfItems()
DynField_v2
getTypeOfItems
in interface DynField_v2
public DynField setValidateElements(boolean validate)
setValidateElements
in interface DynField_v2
public boolean getValidateElements()
getValidateElements
in interface DynField_v2
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Cloneable
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the instance of the object cannot
be cloned. As this is extending Cloneable
so its sure
it implements it, so this exception may be used for problems on specific
object instances.Object#clone()}.