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.

    • 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 with DFFieldPickListCapability
        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 with DFFieldPickListCapability
        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.
        Specified by:
        getHandle in interface DFItem
        Returns:
        The handle to the DFItem.
      • 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.