Class CalculatedField

  • All Implemented Interfaces:
    com.im.df.api.capabilities.DFFieldCalcCapability, com.im.df.api.capabilities.DFFieldCalculatedCapability, com.im.df.api.capabilities.InfoCapability, com.im.df.api.ddl.DFCapability, com.im.df.api.ddl.DFField, com.im.df.api.ddl.DFItem, com.im.df.api.ddl.DFUserItem, com.im.df.api.support.PropertiesEditingConfigurable, com.im.df.api.support.PropertiesEditingConfigurable.Extra

    public final class CalculatedField
    extends com.chemaxon.dif.db.api.field.ColumnlessFieldAbstractImpl
    implements com.im.df.api.capabilities.DFFieldCalculatedCapability, com.im.df.api.ddl.DFUserItem
    Author:
    pzajac
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.chemaxon.dif.db.api.field.FieldAbstract

        com.chemaxon.dif.db.api.field.FieldAbstract.FUpdater
      • Nested classes/interfaces inherited from class com.chemaxon.dif.db.api.item.DBItemAbstractImpl

        com.chemaxon.dif.db.api.item.DBItemAbstractImpl.AbstractUpdater
      • Nested classes/interfaces inherited from interface com.im.df.api.ddl.DFField

        com.im.df.api.ddl.DFField.Required
      • Nested classes/interfaces inherited from interface com.im.df.api.ddl.DFItem

        com.im.df.api.ddl.DFItem.Handle<T extends com.im.df.api.ddl.DFItem>
      • Nested classes/interfaces inherited from interface com.im.df.api.support.PropertiesEditingConfigurable

        com.im.df.api.support.PropertiesEditingConfigurable.Extra
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String GROOVY_LANG
      Groovy script constant.
      • Fields inherited from class com.chemaxon.dif.db.api.item.DBItemAbstractImpl

        DEFAULT_CHARSET
      • Fields inherited from interface com.im.df.api.ddl.DFField

        PROP_DEFAULT_VALUE, PROP_DISTINCT_VALUES, PROP_REQUIRED
      • Fields inherited from interface com.im.df.api.capabilities.DFFieldCalcCapability

        PROP_CALC_TEMPLATE
      • Fields inherited from interface com.im.df.api.ddl.DFItem

        PROP_CAPABILITIES, PROP_DESCRIPTION, PROP_ID, PROP_NAME, PROP_TYPE, PROP_VALID
    • Constructor Summary

      Constructors 
      Constructor Description
      CalculatedField​(com.im.df.api.ddl.DFEntity parent, String id, String name, String desc, String type, int tableIndex, List<com.im.ijcs.api.ddl.dto.PropInfo> xAttrs, String owner, int sharing, boolean iAmOwner)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static String checkReturnValue​(com.im.df.api.util.CalculatedReturnType retType, Object val)  
      protected com.chemaxon.dif.db.api.field.ColumnlessFieldDataTypeAbstractImpl createFieldType​(String type, com.im.df.api.ddl.DFEntity entity, List<com.im.ijcs.api.ddl.dto.PropInfo> xAttrs)  
      static CalculatedField createInstance​(com.chemaxon.dif.db.api.entity.DBEntityAbstractImpl parent, com.im.ijcs.api.ddl.dto.FieldInfo dto, com.im.commons.progress.DFEnvironmentRW env)  
      static CalculatedField createInstance​(com.im.df.api.ddl.DFEntity parent, String id, String name, String desc, String type, int tableIndex, com.im.commons.progress.DFEnvironmentRW rw, List<com.im.ijcs.api.ddl.dto.PropInfo> xAttrs, String owner, int sharing, boolean iAmOwner)  
      com.chemaxon.dif.db.api.item.DBItemAbstractImpl.AbstractUpdater createUpdater()  
      com.im.df.api.support.Calculable getCalcTemplate()  
      com.im.df.api.util.CalculatedReturnType getCalculatedReturnType()  
      com.im.df.api.support.DFDataConvertor getConvertor()  
      Class getFieldClass()  
      com.im.df.api.ddl.DFField[] getParams()  
      static com.im.df.api.util.CalculatedReturnType getReturnTypeFromType​(String type)  
      com.im.df.api.support.Scriptable getScriptable()  
      com.im.df.api.capabilities.DFFieldDataTypeCapability getTypeCapability()  
      com.im.ijcs.api.ddl.dto.FieldInfo getXmlBean()  
      void handleChanges​(com.im.ijcs.api.ddl.dto.ItemPersistentInfo nue)  
      void initCalcTemplate​(com.im.df.api.support.CalculableGroovyTemplate template)  
      boolean isQueryable()
      boolean isSortable()  
      void setCalcTemplate​(com.im.df.api.support.Calculable template, com.im.commons.progress.DFEnvironmentRW env)  
      • Methods inherited from class com.chemaxon.dif.db.api.field.ColumnlessFieldAbstractImpl

        getDefaultValue, getEntity, getEntityImpl, getHandle, getNameValidator, getRequired, getSchema, getSchemaImpl, getTooltip, getType, getValidRequiredValues, init, initType, isDistinctValues, removeField, setDefaultValue, setDistinctValues, setRequired, updateFieldType
      • Methods inherited from class com.chemaxon.dif.db.api.field.FieldAbstract

        getXAttributes, putXAttribute
      • Methods inherited from class com.chemaxon.dif.db.api.item.DBItemAbstractImpl

        activateItem, addCapabilitiesFromCapabilityProviders, addCapability, addCommaSeparatedPropsForToString, addPropertyChangeListener, doGetHandle, ensureValid, equals, findOwner, firePropertyChange, firePropertyChange, getCapabilities, getDescription, getId, getName, getXAttributesImpl, handleOwner, handleUpdateDescription, handleUpdateName, handleXAttrs, hashCode, initXAttributes, invalidate, invalidateSubitems, isActive, isCapabilityProviderAllowed, isDifferent, isPropertyEditable, isValid, removeCapability, removePropertyChangeListener, replaceCapability, setDescription, setName, setPropertyEditable, toString
      • 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
      • Methods inherited from interface com.im.df.api.support.PropertiesEditingConfigurable.Extra

        setPropertyEditable
    • Constructor Detail

      • CalculatedField

        public CalculatedField​(com.im.df.api.ddl.DFEntity parent,
                               String id,
                               String name,
                               String desc,
                               String type,
                               int tableIndex,
                               List<com.im.ijcs.api.ddl.dto.PropInfo> xAttrs,
                               String owner,
                               int sharing,
                               boolean iAmOwner)
    • Method Detail

      • createFieldType

        protected com.chemaxon.dif.db.api.field.ColumnlessFieldDataTypeAbstractImpl createFieldType​(String type,
                                                                                                    com.im.df.api.ddl.DFEntity entity,
                                                                                                    List<com.im.ijcs.api.ddl.dto.PropInfo> xAttrs)
        Specified by:
        createFieldType in class com.chemaxon.dif.db.api.field.ColumnlessFieldAbstractImpl
      • getXmlBean

        public com.im.ijcs.api.ddl.dto.FieldInfo getXmlBean()
        Overrides:
        getXmlBean in class com.chemaxon.dif.db.api.field.ColumnlessFieldAbstractImpl
      • getReturnTypeFromType

        public static com.im.df.api.util.CalculatedReturnType getReturnTypeFromType​(String type)
      • checkReturnValue

        public static String checkReturnValue​(com.im.df.api.util.CalculatedReturnType retType,
                                              Object val)
      • getCalculatedReturnType

        public com.im.df.api.util.CalculatedReturnType getCalculatedReturnType()
      • initCalcTemplate

        public void initCalcTemplate​(com.im.df.api.support.CalculableGroovyTemplate template)
      • handleChanges

        public void handleChanges​(com.im.ijcs.api.ddl.dto.ItemPersistentInfo nue)
        Overrides:
        handleChanges in class com.chemaxon.dif.db.api.item.DBItemAbstractImpl
      • createInstance

        public static CalculatedField createInstance​(com.im.df.api.ddl.DFEntity parent,
                                                     String id,
                                                     String name,
                                                     String desc,
                                                     String type,
                                                     int tableIndex,
                                                     com.im.commons.progress.DFEnvironmentRW rw,
                                                     List<com.im.ijcs.api.ddl.dto.PropInfo> xAttrs,
                                                     String owner,
                                                     int sharing,
                                                     boolean iAmOwner)
      • createInstance

        public static CalculatedField createInstance​(com.chemaxon.dif.db.api.entity.DBEntityAbstractImpl parent,
                                                     com.im.ijcs.api.ddl.dto.FieldInfo dto,
                                                     com.im.commons.progress.DFEnvironmentRW env)
      • getParams

        public com.im.df.api.ddl.DFField[] getParams()
        Returns:
        fields used in CalculableGroovyTemplate script which determines this calculated field value.
      • getScriptable

        public com.im.df.api.support.Scriptable getScriptable()
      • getTypeCapability

        public com.im.df.api.capabilities.DFFieldDataTypeCapability getTypeCapability()
        Specified by:
        getTypeCapability in interface com.im.df.api.capabilities.DFFieldCalculatedCapability
      • getFieldClass

        public Class getFieldClass()
        Specified by:
        getFieldClass in interface com.im.df.api.ddl.DFField
        Overrides:
        getFieldClass in class com.chemaxon.dif.db.api.field.ColumnlessFieldAbstractImpl
      • getConvertor

        public com.im.df.api.support.DFDataConvertor getConvertor()
        Specified by:
        getConvertor in interface com.im.df.api.ddl.DFField
        Overrides:
        getConvertor in class com.chemaxon.dif.db.api.field.ColumnlessFieldAbstractImpl
      • isSortable

        public boolean isSortable()
        Specified by:
        isSortable in interface com.im.df.api.ddl.DFField
        Overrides:
        isSortable in class com.chemaxon.dif.db.api.field.ColumnlessFieldAbstractImpl
      • isQueryable

        public boolean isQueryable()

        Calculated fields are queryable.

        Specified by:
        isQueryable in interface com.im.df.api.ddl.DFField
        Overrides:
        isQueryable in class com.chemaxon.dif.db.api.field.ColumnlessFieldAbstractImpl
        Returns:
        true
        Since:
        14.9.8
      • getCalcTemplate

        public com.im.df.api.support.Calculable getCalcTemplate()
        Specified by:
        getCalcTemplate in interface com.im.df.api.capabilities.DFFieldCalcCapability
      • setCalcTemplate

        public void setCalcTemplate​(com.im.df.api.support.Calculable template,
                                    com.im.commons.progress.DFEnvironmentRW env)
        Specified by:
        setCalcTemplate in interface com.im.df.api.capabilities.DFFieldCalcCapability
      • createUpdater

        public com.chemaxon.dif.db.api.item.DBItemAbstractImpl.AbstractUpdater createUpdater()
        Specified by:
        createUpdater in class com.chemaxon.dif.db.api.item.DBItemAbstractImpl