Package net.pricefx.domain
Class DMField
Object
DMField
- All Implemented Interfaces:
DMEntityMap.DMEntityField,DMExpression.DMVariable,MetaDescribable,Variable
@Embeddable
public class DMField
extends Object
implements DMEntityMap.DMEntityField, DMExpression.DMVariable, MetaDescribable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface MetaDescribable
MAX_META_DESCRIPTION_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDependencies(Collection<String> dependencies) voidaddErrorMessage(String message) Add an error message on DMField level, not for a specific DMField attributevoidaddErrorMessage(String field, String message) Add an error message pertaining to a DMField attributevoidaddWarningMessage(String message) Add a warning message on DMField level, not for a specific DMField attributevoidaddWarningMessage(String field, String message) Add a warning message pertaining to a DMField attributevoidvoidcopy()booleanprotected Stringprotected final DMField.Conversionprotected final DMField.ConversionDMEntityMap.DMEntityDMExpression.DMFunctionFieldFunctiongetLabel()For a translated object, the legacy "label" field may serve as a non-translated technical label.A Map, with locale (String) as key and translated label (String) as value.MeasureTypeValidationVisitorWithWarningsgetName()intgetRank()static StringgetTimeDimFieldName(DMField dateField, CalendarUtil.TimeUnit timeUnit) getType()static FieldTypegetType(AttributeMeta attrib) protected StringgetValue(FormulaEngineContext context) Defines the variable's behavior.booleaninthashCode()booleanhasSource(DMFieldCollection fc) booleanhasSource(DMQuery query) booleanbooleanisAssignable(Object value) booleanbooleanbooleanbooleanbooleanbooleanbooleanisKey()booleanbooleanbooleanbooleanbooleanbooleanbooleanisSystem()booleanisTime()parseValue(Object value) voidprepareAsDtoForUpdate(PersistedObjectService objService) protected voidsetCcyField(String ccyField) protected final voidsetConversion(DMField.Conversion conversion) voidsetDataType(DataType dataType) voidsetDbColumn(String column) voidsetDbTable(String table) protected final voidsetDefaultConversion(DMField.Conversion defaultConversion) voidsetDefaultValue(Object defaultValue) voidsetDependencies(String dependencies) voidsetDependencies(Collection<String> dependencies) protected voidsetEntity(DMEntityMap.DMEntity parent) voidsetExpression(String expression) voidvoidsetFormulaElement(String elementName) voidsetFunction(DMExpression.DMFunction function) voidsetFunctionalType(FieldFunction functionalType) protected voidsetInternalExpr(String internalExpr) protected voidsetIsAggregation(boolean isAggregation) voidsetIsAuxiliary(Boolean isAuxiliary) protected voidsetIsCalculated(boolean isCalculated) protected voidsetIsDeployed(Boolean isDeployed) voidsetIsDimension(boolean isDim) voidsetIsDistributionKey(boolean distributionKey) voidsetIsKey(boolean isKey) voidsetIsPartitioningKey(boolean isPartitioningKey) protected voidsetIsPersisted(Boolean isPersisted) voidsetIsQueryable(Boolean isQueryable) voidvoidvoidsetLabelTranslations(Map<String, String> labelTranslations) A map, with locale (String) as key and translated label (String) as value.protected voidsetMeasureType(MeasureType measureType) voidsetMetaDescription(String metaDescription) protected voidprotected voidsetOwningFC(String owningFC) protected voidsetOwningFC(DMFieldCollection owningFC) voidsetRank(int rank) protected voidvoidsetSource(DMFieldCollection source) voidsetSource(DMQuery query) voidsetSourceField(String sourceField) voidvoidprotected voidsetUomField(String uomField) voidsetVisibility(Integer visibility) toString()static FieldTypeprotected voidprotected final booleanvalidate(DMExpression.DMExpressionContext context, ValidationVisitor validationVisitor, boolean updateMode)
-
Field Details
-
FIELD_NAME
- See Also:
-
FIELD_LABEL
- See Also:
-
FIELD_TYPE
- See Also:
-
FIELD_DIMENSION
- See Also:
-
FIELD_RANK
- See Also:
-
FIELD_KEY
- See Also:
-
FIELD_EXPRESSION
- See Also:
-
FIELD_ISCALCULATED
- See Also:
-
FIELD_SOURCE
- See Also:
-
FIELD_SOURCEFIELD
- See Also:
-
FIELD_FORMAT
- See Also:
-
FIELD_FORMULAELEMENT
- See Also:
-
FIELD_PARTITIONINGKEY
- See Also:
-
FIELD_DISTRIBUTIONKEY
- See Also:
-
FIELD_OWNINGFC
- See Also:
-
FIELD_CONVERSION
- See Also:
-
SYSTEM
- See Also:
-
WILDCARD
- See Also:
-
CALENDAR_SOURCENAME
-
labelTranslations
-
-
Constructor Details
-
DMField
public DMField() -
DMField
-
-
Method Details
-
copy
-
update
-
getName
- Specified by:
getNamein interfaceDMExpression.DMVariable
-
setName
-
getEntity
public DMEntityMap.DMEntity getEntity()- Specified by:
getEntityin interfaceDMEntityMap.DMEntityField
-
setEntity
protected void setEntity(DMEntityMap.DMEntity parent) -
setLabel
-
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:
getLabelin interfaceDMExpression.DMVariable
-
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
A map, with locale (String) as key and translated label (String) as value. -
setLabel
-
getMetaDescription
-
setMetaDescription
-
getRank
public int getRank() -
setRank
public void setRank(int rank) -
getType
-
setType
-
getDataType
- Specified by:
getDataTypein interfaceDMExpression.DMVariable
-
setDataType
-
setType
-
toType
-
getType
-
getFormat
-
setFormat
-
isDimension
public boolean isDimension()- Specified by:
isDimensionin interfaceDMEntityMap.DMEntityField
-
setIsDimension
public void setIsDimension(boolean isDim) -
getFunctionalType
public FieldFunction getFunctionalType() -
setFunctionalType
public void setFunctionalType(FieldFunction functionalType) -
getVisibility
-
setVisibility
-
getMeasureType
public MeasureType getMeasureType() -
setMeasureType
protected void setMeasureType(MeasureType measureType) -
isKey
public boolean isKey()- Specified by:
isKeyin interfaceDMEntityMap.DMEntityField
-
setIsKey
public void setIsKey(boolean isKey) -
isPartitioningKey
public boolean isPartitioningKey()- Specified by:
isPartitioningKeyin interfaceDMEntityMap.DMEntityField
-
setIsPartitioningKey
public void setIsPartitioningKey(boolean isPartitioningKey) -
isDistributionKey
public boolean isDistributionKey()- Specified by:
isDistributionKeyin interfaceDMEntityMap.DMEntityField
-
setIsDistributionKey
public void setIsDistributionKey(boolean distributionKey) -
isTime
public boolean isTime()- Specified by:
isTimein interfaceDMExpression.DMVariable
-
clearConversion
public void clearConversion() -
getConversion
-
setConversion
-
getDefaultConversion
-
setDefaultConversion
-
isCalendarField
public boolean isCalendarField() -
getExpression
- Specified by:
getExpressionin interfaceDMEntityMap.DMEntityField- Specified by:
getExpressionin interfaceDMExpression.DMVariable
-
setExpression
-
isCalculated
public boolean isCalculated()- Specified by:
isCalculatedin interfaceDMEntityMap.DMEntityField
-
setIsCalculated
protected void setIsCalculated(boolean isCalculated) -
hasConversion
public boolean hasConversion() -
isQueryable
public boolean isQueryable() -
setIsQueryable
-
isAuxiliary
public boolean isAuxiliary() -
setIsAuxiliary
-
isPersisted
public boolean isPersisted()- Specified by:
isPersistedin interfaceDMEntityMap.DMEntityField
-
setIsPersisted
-
isDeployed
public boolean isDeployed() -
setIsDeployed
-
isAggregation
public boolean isAggregation()- Specified by:
isAggregationin interfaceDMExpression.DMVariable
-
setIsAggregation
protected void setIsAggregation(boolean isAggregation) -
isPerUnitBasis
public boolean isPerUnitBasis() -
isPercentBasis
public boolean isPercentBasis() -
isPricingDate
public boolean isPricingDate() -
getDefaultValue
- Specified by:
getDefaultValuein interfaceDMExpression.DMVariable
-
setDefaultValue
-
getSource
-
setSource
-
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
-
setSourceField
-
getOwningFC
-
setOwningFC
-
setOwningFC
protected void setOwningFC(DMFieldCollection owningFC) -
isSystem
public boolean isSystem() -
getFormulaElement
-
setFormulaElement
-
getFunction
public DMExpression.DMFunction getFunction() -
setFunction
public void setFunction(DMExpression.DMFunction function) -
getDependencies
- Specified by:
getDependenciesin interfaceDMEntityMap.DMEntityField
-
getDependenciesAsList
-
setDependencies
-
setDependencies
-
addDependencies
-
clearDependencies
public void clearDependencies() -
getUomField
-
setUomField
-
getCcyField
-
setCcyField
-
getTimeDimFieldName
-
getDbColumn
- Specified by:
getDbColumnin interfaceDMEntityMap.DMEntityField
-
setDbColumn
- Specified by:
setDbColumnin interfaceDMEntityMap.DMEntityField
-
getDbTable
- Specified by:
getDbTablein interfaceDMEntityMap.DMEntityField
-
setDbTable
- Specified by:
setDbTablein interfaceDMEntityMap.DMEntityField
-
getInternalExpr
-
setInternalExpr
-
getValue
Description copied from interface:net.pricefx.formulaengine.hooks.VariableDefines 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 nevernull.- Specified by:
getValuein interfaceVariable- Returns:
- the variable contents. Supported return types are
String,IntegerandDouble.
-
parseValue
- Specified by:
parseValuein interfaceDMEntityMap.DMEntityField
-
isAssignable
- Specified by:
isAssignablein interfaceDMEntityMap.DMEntityField
-
getMessages
public ValidationVisitorWithWarnings getMessages() -
addErrorMessage
Add an error message on DMField level, not for a specific DMField attribute -
addErrorMessage
Add an error message pertaining to a DMField attribute -
addWarningMessage
Add a warning message on DMField level, not for a specific DMField attribute -
addWarningMessage
Add a warning message pertaining to a DMField attribute -
getErrorMessagesAsMap
-
toString
-
toStringExt
-
prepareAsDtoForUpdate
public void prepareAsDtoForUpdate(PersistedObjectService objService) -
hashCode
public int hashCode() -
equals
-
validate
protected final boolean validate(DMExpression.DMExpressionContext context, ValidationVisitor validationVisitor, boolean updateMode)
-