Class DMField

Object
DMField
All Implemented Interfaces:
DMEntityMap.DMEntityField, DMExpression.DMVariable, Variable

@Embeddable public class DMField extends Object implements DMEntityMap.DMEntityField, DMExpression.DMVariable
  • Field Details

  • Constructor Details

    • DMField

      public DMField()
    • DMField

      public DMField(String name, FieldType type)
  • Method Details

    • copy

      public DMField copy()
    • update

      protected void update(DMField otherField)
    • getName

      public String getName()
      Specified by:
      getName in interface DMExpression.DMVariable
    • setName

      protected void setName(String name)
    • getEntity

      public DMEntityMap.DMEntity getEntity()
      Specified by:
      getEntity in interface DMEntityMap.DMEntityField
    • setEntity

      protected void setEntity(DMEntityMap.DMEntity parent)
    • setLabel

      public void setLabel(String label)
    • getLabel

      public String getLabel()
      For a translated object, the legacy "label" field may serve as a non-translated technical label. It depends on the object type, whether this label may prove useful or not.
      I.e. it should serve as a default in case no translation were ever set, and once translations exist it might never be displayed, or only serve in low level admin/config UI pages.
      Specified by:
      getLabel in interface DMExpression.DMVariable
    • getLabelTranslations

      public Map<String,String> getLabelTranslations()
      A Map, with locale (String) as key and translated label (String) as value. A "default" translation can be defined with locale key "", the UI should try to find a translation for the it's preferred locale, if it can't a value, it should fall back on the "" locale, and lastly it should fall back on getLabel().
    • setLabelTranslations

      public void setLabelTranslations(Map<String,String> labelTranslations)
      A map, with locale (String) as key and translated label (String) as value.
    • setLabel

      public void setLabel(Msg i18nLabelFormat, Object... args)
    • getRank

      public int getRank()
    • setRank

      public void setRank(int rank)
    • getType

      public FieldType getType()
    • setType

      public void setType(FieldType type)
    • getDataType

      public DataType getDataType()
      Specified by:
      getDataType in interface DMExpression.DMVariable
    • setType

      public void setType(DataType dataType)
    • toType

      public static FieldType toType(DataType dataType)
    • getType

      public static FieldType getType(AttributeMeta attrib)
    • getFormat

      public String getFormat()
    • setFormat

      public void setFormat(String format)
    • isNumeric

      public boolean isNumeric()
    • isDimension

      public boolean isDimension()
      Specified by:
      isDimension in interface DMEntityMap.DMEntityField
    • setIsDimension

      public void setIsDimension(boolean isDim)
    • getFunctionalType

      public FieldFunction getFunctionalType()
    • setFunctionalType

      public void setFunctionalType(FieldFunction functionalType)
    • getVisibility

      public Integer getVisibility()
    • setVisibility

      public void setVisibility(Integer visibility)
    • getMeasureType

      public MeasureType getMeasureType()
    • setMeasureType

      protected void setMeasureType(MeasureType measureType)
    • isKey

      public boolean isKey()
      Specified by:
      isKey in interface DMEntityMap.DMEntityField
    • setIsKey

      protected void setIsKey(boolean isKey)
    • isPartitioningKey

      public boolean isPartitioningKey()
      Specified by:
      isPartitioningKey in interface DMEntityMap.DMEntityField
    • setIsPartitioningKey

      public void setIsPartitioningKey(boolean isPartitioningKey)
      Specified by:
      setIsPartitioningKey in interface DMEntityMap.DMEntityField
    • isTime

      public boolean isTime()
      Specified by:
      isTime in interface DMExpression.DMVariable
    • setIsTime

      protected void setIsTime(boolean isTime)
    • isCalendarField

      public boolean isCalendarField()
    • getExpression

      public String getExpression()
      Specified by:
      getExpression in interface DMEntityMap.DMEntityField
      Specified by:
      getExpression in interface DMExpression.DMVariable
    • setExpression

      public void setExpression(String expression)
    • isCalculated

      public boolean isCalculated()
      Specified by:
      isCalculated in interface DMEntityMap.DMEntityField
    • setIsCalculated

      protected void setIsCalculated(boolean isCalculated)
    • isQueryable

      public boolean isQueryable()
    • setIsQueryable

      public void setIsQueryable(Boolean isQueryable)
    • isAuxiliary

      public boolean isAuxiliary()
    • setIsAuxiliary

      public void setIsAuxiliary(Boolean isAuxiliary)
    • isPersisted

      public boolean isPersisted()
      Specified by:
      isPersisted in interface DMEntityMap.DMEntityField
    • setIsPersisted

      protected void setIsPersisted(Boolean isPersisted)
    • isDeployed

      public boolean isDeployed()
    • setIsDeployed

      protected void setIsDeployed(Boolean isDeployed)
    • isDeleted

      public boolean isDeleted()
    • setIsDeleted

      protected void setIsDeleted(Boolean isDeleted)
    • isAggregation

      public boolean isAggregation()
      Specified by:
      isAggregation in interface DMExpression.DMVariable
    • setIsAggregation

      protected void setIsAggregation(boolean isAggregation)
    • isPerUnitBasis

      public boolean isPerUnitBasis()
    • isPercentBasis

      public boolean isPercentBasis()
    • isPricingDate

      public boolean isPricingDate()
    • getDefaultValue

      public Object getDefaultValue()
      Specified by:
      getDefaultValue in interface DMExpression.DMVariable
    • setDefaultValue

      public void setDefaultValue(Object defaultValue)
    • getSource

      public String getSource()
    • setSource

      protected void setSource(String source)
    • setSource

      public void setSource(DMFieldCollection source)
    • hasSource

      public boolean hasSource(DMFieldCollection fc)
    • hasSource

      public boolean hasSource(DMQuery query)
    • setSource

      public void setSource(DMQuery query)
    • getSourceField

      public String getSourceField()
    • setSourceField

      public void setSourceField(String sourceField)
    • getOwningFC

      public String getOwningFC()
    • setOwningFC

      protected void setOwningFC(String owningFC)
    • setOwningFC

      protected void setOwningFC(DMFieldCollection owningFC)
    • isSystem

      public boolean isSystem()
    • getFormulaElement

      public String getFormulaElement()
    • setFormulaElement

      public void setFormulaElement(String elementName)
    • getFunction

      public DMExpression.DMFunction getFunction()
    • setFunction

      public void setFunction(DMExpression.DMFunction function)
    • getDependencies

      public String getDependencies()
      Specified by:
      getDependencies in interface DMEntityMap.DMEntityField
    • getDependenciesAsList

      public List<String> getDependenciesAsList()
    • setDependencies

      public void setDependencies(String dependencies)
    • getUomField

      public String getUomField()
    • setUomField

      protected void setUomField(String uomField)
    • getCcyField

      public String getCcyField()
    • setCcyField

      protected void setCcyField(String ccyField)
    • getConversionRateFieldName

      public static String getConversionRateFieldName(String fromFieldName, String toFieldName)
    • getTimeDimFieldName

      public static String getTimeDimFieldName(DMField dateField, CalendarUtil.TimeUnit timeUnit)
    • getDbColumn

      public String getDbColumn()
      Specified by:
      getDbColumn in interface DMEntityMap.DMEntityField
    • setDbColumn

      public void setDbColumn(String column)
      Specified by:
      setDbColumn in interface DMEntityMap.DMEntityField
    • getDbTable

      public String getDbTable()
      Specified by:
      getDbTable in interface DMEntityMap.DMEntityField
    • setDbTable

      public void setDbTable(String table)
      Specified by:
      setDbTable in interface DMEntityMap.DMEntityField
    • resolveExpression

      protected static String resolveExpression(String internalExpr, String uomRate, String ccyRate)
    • resolveExpression

      protected static String resolveExpression(String internalExpr, String uomRate, String ccyRate, String quantityField)
    • getInternalExpr

      public String getInternalExpr()
    • initInternalExpr

      protected void initInternalExpr()
    • setInternalExpr

      protected void setInternalExpr(String internalExpr)
    • getValue

      public Object getValue(FormulaEngineContext context)
      Description copied from interface: net.pricefx.formulaengine.hooks.Variable
      Defines the variable's behavior. As no problems could be expected from getting a known variable it can be expected to always return a legal value, hence the return value should be never null.
      Specified by:
      getValue in interface Variable
      Returns:
      the variable contents. Supported return types are String, Integer and Double .
    • parseValue

      public Object parseValue(Object value)
      Specified by:
      parseValue in interface DMEntityMap.DMEntityField
    • isAssignable

      public boolean isAssignable(Object value)
      Specified by:
      isAssignable in interface DMEntityMap.DMEntityField
    • getMessages

      public ValidationVisitor getMessages()
    • addMessage

      public ValidationVisitor addMessage(String message)
      Add a message on DMField level, not for a specific DMField attribute
    • addMessage

      public ValidationVisitor addMessage(String field, String message)
      Add a message pertaining to a DMField attribute
    • getMessagesAsMap

      public Map<String,?> getMessagesAsMap()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toStringExt

      public String toStringExt()
    • prepareAsDtoForUpdate

      public void prepareAsDtoForUpdate(PersistedObjectService objService)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • validate

      protected final boolean validate(DMExpression.DMExpressionContext context, ValidationVisitor ValidationVisitor, boolean updateMode)