Package net.pricefx.domain
Class DMField
Object
DMField
- All Implemented Interfaces:
DMEntityMap.DMEntityField
,DMExpression.DMVariable
,Variable
@Embeddable
public class DMField
extends Object
implements DMEntityMap.DMEntityField, DMExpression.DMVariable
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionValidationVisitor
addMessage
(String message) Add a message on DMField level, not for a specific DMField attributeValidationVisitor
addMessage
(String field, String message) Add a message pertaining to a DMField attributecopy()
boolean
static String
getConversionRateFieldName
(String fromFieldName, String toFieldName) DMEntityMap.DMEntity
DMExpression.DMFunction
FieldFunction
getLabel()
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.MeasureType
ValidationVisitor
getName()
int
getRank()
static String
getTimeDimFieldName
(DMField dateField, CalendarUtil.TimeUnit timeUnit) getType()
static FieldType
getType
(AttributeMeta attrib) getValue
(FormulaEngineContext context) Defines the variable's behavior.int
hashCode()
boolean
hasSource
(DMFieldCollection fc) boolean
hasSource
(DMQuery query) protected void
boolean
boolean
isAssignable
(Object value) boolean
boolean
boolean
boolean
boolean
boolean
boolean
isKey()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isSystem()
boolean
isTime()
parseValue
(Object value) void
prepareAsDtoForUpdate
(PersistedObjectService objService) protected static String
resolveExpression
(String internalExpr, String uomRate, String ccyRate, String quantityField) protected void
setCcyField
(String ccyField) void
setDbColumn
(String column) void
setDbTable
(String table) void
setDefaultValue
(Object defaultValue) void
setDependencies
(String dependencies) protected void
setEntity
(DMEntityMap.DMEntity parent) void
setExpression
(String expression) void
void
setFormulaElement
(String elementName) void
setFunction
(DMExpression.DMFunction function) void
setFunctionalType
(FieldFunction functionalType) protected void
setInternalExpr
(String internalExpr) protected void
setIsAggregation
(boolean isAggregation) void
setIsAuxiliary
(Boolean isAuxiliary) protected void
setIsCalculated
(boolean isCalculated) protected void
setIsDeployed
(Boolean isDeployed) void
setIsDimension
(boolean isDim) void
setIsDistributionKey
(boolean distributionKey) void
setIsKey
(boolean isKey) void
setIsPartitioningKey
(boolean isPartitioningKey) protected void
setIsPersisted
(Boolean isPersisted) void
setIsQueryable
(Boolean isQueryable) void
void
void
setLabelTranslations
(Map<String, String> labelTranslations) A map, with locale (String) as key and translated label (String) as value.protected void
setMeasureType
(MeasureType measureType) protected void
protected void
setOwningFC
(String owningFC) protected void
setOwningFC
(DMFieldCollection owningFC) void
setRank
(int rank) protected void
void
setSource
(DMFieldCollection source) void
setSource
(DMQuery query) void
setSourceField
(String sourceField) void
void
protected void
setUomField
(String uomField) void
setVisibility
(Integer visibility) toString()
static FieldType
protected void
protected final boolean
validate
(DMExpression.DMExpressionContext context, ValidationVisitor ValidationVisitor, boolean updateMode)
-
Field Details
-
FIELD_NAME
- See Also:
-
FIELD_LABEL
- See Also:
-
FIELD_TYPE
- See Also:
-
FIELD_EXPRESSION
- 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:
-
SYSTEM
- See Also:
-
WILDCARD
- See Also:
-
CALENDAR_SOURCENAME
-
labelTranslations
-
-
Constructor Details
-
DMField
public DMField() -
DMField
-
-
Method Details
-
copy
-
update
-
getName
- Specified by:
getName
in interfaceDMExpression.DMVariable
-
setName
-
getEntity
public DMEntityMap.DMEntity getEntity()- Specified by:
getEntity
in 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:
getLabel
in 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
-
getRank
public int getRank() -
setRank
public void setRank(int rank) -
getType
-
setType
-
getDataType
- Specified by:
getDataType
in interfaceDMExpression.DMVariable
-
setType
-
toType
-
getType
-
getFormat
-
setFormat
-
isNumeric
public boolean isNumeric() -
isDimension
public boolean isDimension()- Specified by:
isDimension
in 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:
isKey
in interfaceDMEntityMap.DMEntityField
-
setIsKey
public void setIsKey(boolean isKey) -
isPartitioningKey
public boolean isPartitioningKey()- Specified by:
isPartitioningKey
in interfaceDMEntityMap.DMEntityField
-
setIsPartitioningKey
public void setIsPartitioningKey(boolean isPartitioningKey) -
isDistributionKey
public boolean isDistributionKey()- Specified by:
isDistributionKey
in interfaceDMEntityMap.DMEntityField
-
setIsDistributionKey
public void setIsDistributionKey(boolean distributionKey) -
isTime
public boolean isTime()- Specified by:
isTime
in interfaceDMExpression.DMVariable
-
isCalendarField
public boolean isCalendarField() -
getExpression
- Specified by:
getExpression
in interfaceDMEntityMap.DMEntityField
- Specified by:
getExpression
in interfaceDMExpression.DMVariable
-
setExpression
-
isCalculated
public boolean isCalculated()- Specified by:
isCalculated
in interfaceDMEntityMap.DMEntityField
-
setIsCalculated
protected void setIsCalculated(boolean isCalculated) -
isQueryable
public boolean isQueryable() -
setIsQueryable
-
isAuxiliary
public boolean isAuxiliary() -
setIsAuxiliary
-
isPersisted
public boolean isPersisted()- Specified by:
isPersisted
in interfaceDMEntityMap.DMEntityField
-
setIsPersisted
-
isDeployed
public boolean isDeployed() -
setIsDeployed
-
isAggregation
public boolean isAggregation()- Specified by:
isAggregation
in interfaceDMExpression.DMVariable
-
setIsAggregation
protected void setIsAggregation(boolean isAggregation) -
isPerUnitBasis
public boolean isPerUnitBasis() -
isPercentBasis
public boolean isPercentBasis() -
isPricingDate
public boolean isPricingDate() -
getDefaultValue
- Specified by:
getDefaultValue
in 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:
getDependencies
in interfaceDMEntityMap.DMEntityField
-
getDependenciesAsList
-
setDependencies
-
getUomField
-
setUomField
-
getCcyField
-
setCcyField
-
getConversionRateFieldName
-
getTimeDimFieldName
-
getDbColumn
- Specified by:
getDbColumn
in interfaceDMEntityMap.DMEntityField
-
setDbColumn
- Specified by:
setDbColumn
in interfaceDMEntityMap.DMEntityField
-
getDbTable
- Specified by:
getDbTable
in interfaceDMEntityMap.DMEntityField
-
setDbTable
- Specified by:
setDbTable
in interfaceDMEntityMap.DMEntityField
-
resolveExpression
-
getInternalExpr
-
initInternalExpr
protected void initInternalExpr() -
setInternalExpr
-
getValue
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 nevernull
.- Specified by:
getValue
in interfaceVariable
- Returns:
- the variable contents. Supported return types are
String
,Integer
andDouble
.
-
parseValue
- Specified by:
parseValue
in interfaceDMEntityMap.DMEntityField
-
isAssignable
- Specified by:
isAssignable
in interfaceDMEntityMap.DMEntityField
-
getMessages
public ValidationVisitor getMessages() -
addMessage
Add a message on DMField level, not for a specific DMField attribute -
addMessage
Add a message pertaining to a DMField attribute -
getMessagesAsMap
-
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)
-