com.im.df.api 5.8

com.im.df.api.ddl
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 a DFEntity.

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
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
static String PROP_DEFAULT_VALUE
           
static String PROP_DISTINCT_VALUES
           
static 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
 DFDataConvertor getConvertor()
           
 DefaultValue getDefaultValue()
          Get the default value to use for this field if none is specified.
 DFEntity getEntity()
           
 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.
 Map<String,String> getXAttributes()
           
 boolean isDistinctValues()
          Getter for property distinctValues.
 boolean isQueryable()
          Test whether this field is queryable or not.
 boolean isSortable()
          Test whether this field is sortable or not.
 void putXAttribute(String attrKey, String mimeType, DFEnvironmentRW env)
           
 void setDefaultValue(DefaultValue defaultValue, DFEnvironmentRW env)
          Set the default value to use for this field if none is specified.
 void setDistinctValues(boolean distinctValues, DFEnvironmentRW env)
          Setter for property distinctValues.
 void setRequired(DFField.Required required, 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 String PROP_REQUIRED
See Also:
Constant Field Values

PROP_DISTINCT_VALUES

static final String PROP_DISTINCT_VALUES
See Also:
Constant Field Values

PROP_DEFAULT_VALUE

static final 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

boolean isDistinctValues()
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

void setDistinctValues(boolean distinctValues,
                       DFEnvironmentRW env)
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,
                 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,
                     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

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.

Specified by:
getHandle in interface DFItem
Returns:
The handle to the DFItem.

getXAttributes

Map<String,String> getXAttributes()

putXAttribute

void putXAttribute(String attrKey,
                   String mimeType,
                   DFEnvironmentRW env)

com.im.df.api 5.8