com.im.df.api 5.9

com.im.df.api.ddl
Class DFFields

java.lang.Object
  extended by com.im.df.api.ddl.DFFields

public final class DFFields
extends Object

Utility methods for DFField.


Method Summary
static DFField createBinaryField(DFEntity entity, String fieldName, String columnName, DFEnvironmentRW env)
          Create new binary standard field.
static DFField createBooleanField(DFEntity entity, String fieldName, String columnName, DFEnvironmentRW env)
          Create new boolean standard field.
static DFField createDateField(DFEntity entity, String fieldName, String columnName, DFEnvironmentRW env)
          Create new date field with default column type.
static DFField createFloatField(DFEntity entity, String fieldName, String columnName, int size, int scale, DFEnvironmentRW env)
          Create new float standard field with default column type.
static DFField createIntegerField(DFEntity entity, String fieldName, String columnName, DFEnvironmentRW env)
          Create new integer standard field.
static DFField createTextField(DFEntity entity, String fieldName, String columnName, int size, DFEnvironmentRW env)
          Create new text standard field with default column type (VARCHAR).
static Collection<? extends DFField> findDependentFields(Collection<? extends DFField> fields)
          Finds calculated fields (means fields with DFFieldCalcCapability that use the fields passed in.
static List<? extends DFField> getCategoryFields(DFEntity entity)
          Return fields belonging to the given entity which are appropriate to be used as a category field.
static List<? extends DFField> getCategoryFields(List<? extends DFField> fields)
          Take the given fields and returns only those which are appropriate to be used as a category field.
static boolean isBinary(DFField field)
          Test if this field is of Binary type.
static boolean isBoolean(DFField field)
          Test if this field is of Boolean type.
static boolean isCalculated(DFField field)
          Test if this field is Calculated field.
static boolean isChemicalTerms(DFField field)
          Test if this field is Chemical terms field.
static boolean isDate(DFField field)
          Test if this field is of Date type.
static boolean isDynamicURL(DFField field)
          Test if this field is of Dynamic URL type.
static boolean isEditableValue(DFField field)
          Check whether or not data for the field in entity can be edited.
static boolean isFloat(DFField field)
          Test if this field is of Float type.
static boolean isID(DFField field)
          Tests whether the given field is an ID field within its owning entity.
static boolean isInteger(DFField field)
          Test if this field is of Integer type.
static boolean isRelationField(DFField field)
          Check if column of field represents foreign key.
static boolean isStandard(DFField field)
          Test if this field is Standard field.
static boolean isStaticURL(DFField field)
          Test if this field is of Static URL type.
static boolean isStructure(DFField field)
          Test if this field is of Structure type.
static boolean isText(DFField field)
          Test if this field is of Text type.
static boolean isURL(DFField field)
          Test if this field is of URL type.
static List<String> toNames(List<? extends DFField> fields)
          Function mapping fields to their names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isID

public static boolean isID(DFField field)
Tests whether the given field is an ID field within its owning entity.

Parameters:
field - field to be checked
Returns:
if the field is an ID field

toNames

public static List<String> toNames(List<? extends DFField> fields)
Function mapping fields to their names.

Parameters:
fields - fields to map
Returns:
fields' names

getCategoryFields

public static List<? extends DFField> getCategoryFields(DFEntity entity)
Return fields belonging to the given entity which are appropriate to be used as a category field. That is integer, text, boolean, etc. fields.

Parameters:
entity - the entity
Returns:
category fields

getCategoryFields

public static List<? extends DFField> getCategoryFields(List<? extends DFField> fields)
Take the given fields and returns only those which are appropriate to be used as a category field. That is integer, text, boolean, etc. fields.

Parameters:
fields - fields from which to select category fields
Returns:
category fields

createIntegerField

public static DFField createIntegerField(DFEntity entity,
                                         String fieldName,
                                         String columnName,
                                         DFEnvironmentRW env)
Create new integer standard field.

Parameters:
entity - Target entity.
fieldName - Name of new field.
columnName - Name of column for the new field.
env - Locked environment.
Returns:
new integer field

createBooleanField

public static DFField createBooleanField(DFEntity entity,
                                         String fieldName,
                                         String columnName,
                                         DFEnvironmentRW env)
Create new boolean standard field.

Parameters:
entity - Target entity.
fieldName - Name of new field.
columnName - Name of column for the new field.
env - Locked environment.
Returns:
new boolean field.

createFloatField

public static DFField createFloatField(DFEntity entity,
                                       String fieldName,
                                       String columnName,
                                       int size,
                                       int scale,
                                       DFEnvironmentRW env)
Create new float standard field with default column type.

Parameters:
entity - Target entity.
fieldName - Name of new field.
columnName - Name of column for the new field.
size - if value is -1 default value will be used
scale - if value is -1 default value will be used
env - Locked environment.
Returns:
new float field.

createTextField

public static DFField createTextField(DFEntity entity,
                                      String fieldName,
                                      String columnName,
                                      int size,
                                      DFEnvironmentRW env)
Create new text standard field with default column type (VARCHAR).

Parameters:
entity - Target entity.
fieldName - Name of new field.
columnName - Name of column for the new field.
size - of column, if value is -1 default value will be used
env - Locked environment.
Returns:
new text field

createDateField

public static DFField createDateField(DFEntity entity,
                                      String fieldName,
                                      String columnName,
                                      DFEnvironmentRW env)
Create new date field with default column type.

Parameters:
entity - Target entity.
fieldName - Name of new field.
columnName - Name of column for the new field.
env - Locked environment.
Returns:
new date field

createBinaryField

public static DFField createBinaryField(DFEntity entity,
                                        String fieldName,
                                        String columnName,
                                        DFEnvironmentRW env)
Create new binary standard field.

Parameters:
entity - Target entity.
fieldName - Name of new field.
columnName - Name of column for the new field.
env - Locked environment.
Returns:
new integer field

isInteger

public static boolean isInteger(DFField field)
Test if this field is of Integer type.

Parameters:
field - Field to be tested
Returns:
true if field has DFFieldIntegerCapability

isFloat

public static boolean isFloat(DFField field)
Test if this field is of Float type.

Parameters:
field - Field to be tested
Returns:
true if field has DFFieldFloatCapability

isText

public static boolean isText(DFField field)
Test if this field is of Text type.

Parameters:
field - Field to be tested
Returns:
true if field has DFFieldTextCapability

isBoolean

public static boolean isBoolean(DFField field)
Test if this field is of Boolean type.

Parameters:
field - Field to be tested
Returns:
true if field has DFFieldBooleanCapability

isDate

public static boolean isDate(DFField field)
Test if this field is of Date type.

Parameters:
field - Field to be tested
Returns:
true if field has DFFieldDateCapability

isStructure

public static boolean isStructure(DFField field)
Test if this field is of Structure type.

Parameters:
field - Field to be tested
Returns:
true if field has DFFieldStructureCapability

isBinary

public static boolean isBinary(DFField field)
Test if this field is of Binary type.

Parameters:
field - Field to be tested
Returns:
true if field has DFFieldBinaryCapability

isURL

public static boolean isURL(DFField field)
Test if this field is of URL type. See also isDynamicURL(com.im.df.api.ddl.DFField) and {

Parameters:
field - Field to be tested
Returns:
true if field has DFFieldURLCapability - it means it true for both: dynamic and static column

isDynamicURL

public static boolean isDynamicURL(DFField field)
Test if this field is of Dynamic URL type. Dynamic URL field is a field which doesn't have a database column and URL is calculated on fly from a formula - e.g. www.chemaxon.com/search-results/?q={0}

Parameters:
field - Field to be tested
Returns:
true if field has DFFieldURLCapability and also has DFFieldCalcCapability.

isStaticURL

public static boolean isStaticURL(DFField field)
Test if this field is of Static URL type. Static URL field is a field which contains URL as texts and it has a database column (it's subtype of text field ({@link #isText(com.im.df.api.ddl.DFField) )

Parameters:
field - Field to be tested
Returns:
true if field has DFFieldURLCapability and doesn't have DFFieldCalcCapability.

isCalculated

public static boolean isCalculated(DFField field)
Test if this field is Calculated field.

Parameters:
field - Field to be tested
Returns:
true if field has DFFieldCalculatedCapability

isChemicalTerms

public static boolean isChemicalTerms(DFField field)
Test if this field is Chemical terms field.

Parameters:
field - Field to be tested
Returns:
true if field has DFFieldChemicalTermsCapability

isStandard

public static boolean isStandard(DFField field)
Test if this field is Standard field. Currently it means field is database field AND (not calculated) AND (not chemical terms).

Parameters:
field - Field to be tested
Returns:
true if field has DBFieldCapability and is not isCalculated(com.im.df.api.ddl.DFField) is not isChemicalTerms(com.im.df.api.ddl.DFField)

findDependentFields

public static Collection<? extends DFField> findDependentFields(Collection<? extends DFField> fields)
Finds calculated fields (means fields with DFFieldCalcCapability that use the fields passed in.

Parameters:
fields - The fields to find dependencies for.
Returns:
A collection of calculated fields that use one or more of the fields passed in as their bound parameters.

isEditableValue

public static boolean isEditableValue(DFField field)
Check whether or not data for the field in entity can be edited.

Parameters:
field - input field.
Returns:
true if data are editable.

isRelationField

public static boolean isRelationField(DFField field)
Check if column of field represents foreign key.

Parameters:
field - input field.
Returns:
true if field represents foreign key.

com.im.df.api 5.9