Interface DFField
-
- All Superinterfaces:
DFItem
,PropertiesEditingConfigurable
public interface DFField extends DFItem
The definition of a field which has a type, a name etc. DFFields belong to aDFEntity
.A DFField is an abstraction of a column of data in a DFEntity, typically a database column. A DFField has a defined data type (e.g. Integer, Text, Image, Date etc.) and the DFField abstraction provides the additional information that is not typically present from the JDBC meta data. For example a DFField can describe an image (e.g. a GIF image) which would be stored in a database table as BLOB column. The image DFField would know how to store the image to the database and how to build the data from the BLOB into the image, whereas a different type of DFField (e.g a MP3 field) could also use a BLOB column to persist its data. To the database there is no difference between the two types of columns, but to DIF there is every difference!
Whilst simple DFFields might represent a single database column, the DFField abstraction allows data to be obtained from multiple database columns so that much richer data types than are available in a typical database column are possible. An example could be a DFField for a dose response curve, which could be represented as sets of percent inhibition values present in a separate table.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DFField.Required
Enumeration of required status for fields.-
Nested classes/interfaces inherited from interface com.im.df.api.ddl.DFItem
DFItem.Handle<T extends DFItem>
-
Nested classes/interfaces inherited from interface com.im.df.api.support.PropertiesEditingConfigurable
PropertiesEditingConfigurable.Extra
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROP_DEFAULT_VALUE
static java.lang.String
PROP_DISTINCT_VALUES
Deprecated.As of release 6.3, replaced withDFFieldPickListCapability
static java.lang.String
PROP_REQUIRED
-
Fields inherited from interface com.im.df.api.ddl.DFItem
PROP_CAPABILITIES, PROP_DESCRIPTION, PROP_ID, PROP_NAME, PROP_TYPE, PROP_VALID
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description DFDataConvertor
getConvertor()
DefaultValue
getDefaultValue()
Get the default value to use for this field if none is specified.DFEntity
getEntity()
java.lang.Class<?>
getFieldClass()
DFItem.Handle<DFField>
getHandle()
Returns a handle to the Item.DFField.Required
getRequired()
Getter for property required.DFField.Required[]
getValidRequiredValues()
Which of the required values are valid for this field.java.util.Map<java.lang.String,java.lang.String>
getXAttributes()
Gets all attributes (key-value pairs) for this field.boolean
isDistinctValues()
Deprecated.As of release 6.3, replaced withDFFieldPickListCapability
boolean
isQueryable()
Test whether this field is queryable or not.boolean
isSortable()
Test whether this field is sortable or not.void
putXAttribute(java.lang.String attrKey, java.lang.String attrValue, com.im.commons.progress.DFEnvironmentRW env)
Stores an attribute (key-value pair) for this field.void
setDefaultValue(DefaultValue defaultValue, com.im.commons.progress.DFEnvironmentRW env)
Set the default value to use for this field if none is specified.void
setDistinctValues(boolean distinctValues, com.im.commons.progress.DFEnvironmentRW env)
Deprecated.As of release 6.3, replaced withDFFieldPickListCapability
void
setRequired(DFField.Required required, com.im.commons.progress.DFEnvironmentRW env)
Setter for property required.-
Methods inherited from interface com.im.df.api.ddl.DFItem
addPropertyChangeListener, getCapabilities, getDescription, getId, getName, getType, isValid, removePropertyChangeListener, setDescription, setName
-
Methods inherited from interface com.im.df.api.support.PropertiesEditingConfigurable
isPropertyEditable
-
-
-
-
Field Detail
-
PROP_REQUIRED
static final java.lang.String PROP_REQUIRED
- See Also:
- Constant Field Values
-
PROP_DISTINCT_VALUES
@Deprecated static final java.lang.String PROP_DISTINCT_VALUES
Deprecated.As of release 6.3, replaced withDFFieldPickListCapability
Property with this name is fired when the distinct-values mode of this field has changed. SeeisDistinctValues()
for exact meaning of the property.- See Also:
- Constant Field Values
-
PROP_DEFAULT_VALUE
static final java.lang.String PROP_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getEntity
DFEntity getEntity()
- Returns:
- The entity this field belongs to. Never returns
null
-
isDistinctValues
@Deprecated boolean isDistinctValues()
Deprecated.As of release 6.3, replaced withDFFieldPickListCapability
Getter for property distinctValues. This property is more less hint for user interface code which presents data from this field.Distinct values means that this field contains only limited set of values (something like Enums). UI code should reflect this and for example in search offer combo box with all used values instead of empty input text field.
- Returns:
- Value of property distinctValues.
-
setDistinctValues
@Deprecated void setDistinctValues(boolean distinctValues, com.im.commons.progress.DFEnvironmentRW env)
Deprecated.As of release 6.3, replaced withDFFieldPickListCapability
Setter for property distinctValues.- Parameters:
distinctValues
- New value of property distinctValues.
-
getRequired
DFField.Required getRequired()
Getter for property required.- Returns:
- Value of property required.
-
setRequired
void setRequired(DFField.Required required, com.im.commons.progress.DFEnvironmentRW env)
Setter for property required.- Parameters:
required
- New value of property required.
-
getValidRequiredValues
DFField.Required[] getValidRequiredValues()
Which of the required values are valid for this field.
-
getDefaultValue
DefaultValue getDefaultValue()
Get the default value to use for this field if none is specified. Its class must be appropriate to the field type. Method can return null.- Returns:
- The default value
-
setDefaultValue
void setDefaultValue(DefaultValue defaultValue, com.im.commons.progress.DFEnvironmentRW env)
Set the default value to use for this field if none is specified. Its class must be appropriate to the field type, otherwise method call fails.- Parameters:
defaultValue
- New value for the default
-
getFieldClass
java.lang.Class<?> getFieldClass()
- Returns:
- Java type of the data that is contained in this field
-
isSortable
boolean isSortable()
Test whether this field is sortable or not. Some fields which can't be sorted should return false (e.g. images, structures, etc.). User interface should reflect this and disable sort actions when the field returning false is selected.
-
isQueryable
boolean isQueryable()
Test whether this field is queryable or not. Some fields which can't be queried should return false (e.g. dynamic URL). User interface should reflect this and disable (or omit the field from) query actions when the field returning false is selected.
-
getConvertor
DFDataConvertor getConvertor()
- Returns:
- The Convertor that produces data suitable for this field.
The returned object can also implement
DFDataComparator
(optional). Never returns null.
-
getHandle
DFItem.Handle<DFField> getHandle()
Description copied from interface:DFItem
Returns a handle to the Item. The handle uniquely identifies the Item, even though the schema data may be copied or otherwise replicated. Use the Handle instead of DFItem.getId() when registering an Item in collections that extend beyond the DFItem's parent Schema.
-
getXAttributes
java.util.Map<java.lang.String,java.lang.String> getXAttributes()
Gets all attributes (key-value pairs) for this field.- Returns:
- An immutable map of this field's attributes.
-
putXAttribute
void putXAttribute(java.lang.String attrKey, java.lang.String attrValue, com.im.commons.progress.DFEnvironmentRW env)
Stores an attribute (key-value pair) for this field.- Parameters:
attrKey
- The attribute key (name).attrValue
- The attribute value.env
- Locked environment.
-
-