com.im.df.api 5.9

com.im.df.api.support
Interface DFNewTypeWellKnownOptions.NewCalulatedField

All Superinterfaces:
DFNewTypeOptions, DFNewTypeWellKnownOptions.FieldOptions, DFNewTypeWellKnownOptions.NewDBField, DFNewTypeWellKnownOptions.SingleDFItem
Enclosing interface:
DFNewTypeWellKnownOptions

public static interface DFNewTypeWellKnownOptions.NewCalulatedField
extends DFNewTypeWellKnownOptions.NewDBField

Options for creating new calculated field, you need to validate calc field by using validateScript method.


Field Summary
 
Fields inherited from interface com.im.df.api.support.DFNewTypeWellKnownOptions.SingleDFItem
PROP_DESCRIPTION, PROP_NEW_DFITEM_NAME
 
Fields inherited from interface com.im.df.api.support.DFNewTypeOptions
PROP_ERROR_MESSAGE, PROP_VALID
 
Method Summary
 CalculatedReturnType getCalculatedReturnType()
           
 FieldInfo.Script getExpression()
           
 Map<String,CalculableGroovyTemplate.FieldDetails> getFieldsMapping()
           
 void setExpression(FieldInfo.Script expression)
           
 void setFieldsMapping(Map<String,CalculableGroovyTemplate.FieldDetails> fieldsMapping)
          Set parameters for calculations.
 String validateScript(Map<String,Object> testValues, Object[] retValue)
          Validate calculated field for predefined values.
 
Methods inherited from interface com.im.df.api.support.DFNewTypeWellKnownOptions.NewDBField
getColumns, getDefaultValue, getRequired, isDisctinctValues, setColumnBaseName, setDefaultValue, setDisctinctValues, setRequired
 
Methods inherited from interface com.im.df.api.support.DFNewTypeWellKnownOptions.FieldOptions
createInsertOptions, getConvertor
 
Methods inherited from interface com.im.df.api.support.DFNewTypeWellKnownOptions.SingleDFItem
getDescription, getNewDFItemName, setDescription, setNewDFItemName, setNewDFItemNameSafe
 
Methods inherited from interface com.im.df.api.support.DFNewTypeOptions
addPropertyChangeListener, getErrorMessage, isValid, removeAllPropertyChangeListener, removePropertyChangeListener
 

Method Detail

setExpression

void setExpression(FieldInfo.Script expression)

getExpression

FieldInfo.Script getExpression()

setFieldsMapping

void setFieldsMapping(Map<String,CalculableGroovyTemplate.FieldDetails> fieldsMapping)
Set parameters for calculations.

Parameters:
fieldsMapping - key is variable name.

getFieldsMapping

Map<String,CalculableGroovyTemplate.FieldDetails> getFieldsMapping()

getCalculatedReturnType

CalculatedReturnType getCalculatedReturnType()

validateScript

String validateScript(Map<String,Object> testValues,
                      Object[] retValue)
Validate calculated field for predefined values.

Parameters:
testValues - variable name to value map
retValue - array with size 1 in order to return calculated value
Returns:
error message if validation failed. Otherwise it returns null.

com.im.df.api 5.9