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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMessage(String attribute, String message)
protected void
addValidationError(ValidationVisitor vv, String localizedMessage)
protected void
addValidationError(ValidationVisitor vv, String attribute, String localizedMessage)
protected void
addValidationErrors(ValidationVisitor vv, String attribute, Map<String,List<String>> validationErrors)
DMField
copy()
boolean
equals(Object obj)
String
getCcyField()
static String
getConversionRateFieldName(String fromFieldName, String toFieldName)
DataType
getDataType()
String
getDbColumn()
String
getDbTable()
Object
getDefaultValue()
String
getDependencies()
List<String>
getDependenciesAsList()
DMEntityMap.DMEntity
getEntity()
String
getExpression()
String
getFormat()
String
getFormulaElement()
DMExpression.DMFunction
getFunction()
FieldFunction
getFunctionalType()
String
getInternalExpr()
String
getLabel()
For a translated object, the legacy "label" field may serve as a non-translated technical label.Map<String,String>
getLabelTranslations()
A Map, with locale (String) as key and translated label (String) as value.MeasureType
getMeasureType()
Map<String,?>
getMessages()
String
getName()
String
getOwningFC()
int
getRank()
String
getSource()
String
getSourceField()
static String
getTimeDimFieldName(DMField dateField, CalendarUtil.TimeUnit timeUnit)
FieldType
getType()
static FieldType
getType(AttributeMeta attrib)
String
getUomField()
Object
getValue(FormulaEngineContext context)
Defines the variable's behavior.Integer
getVisibility()
int
hashCode()
boolean
hasSource(DMFieldCollection fc)
boolean
hasSource(DMQuery query)
protected void
initInternalExpr()
boolean
isAggregation()
boolean
isAssignable(Object value)
boolean
isAuxiliary()
boolean
isCalculated()
boolean
isCalendarField()
boolean
isDeleted()
boolean
isDeployed()
boolean
isDimension()
boolean
isKey()
boolean
isNumeric()
boolean
isPartitioningKey()
boolean
isPercentBasis()
boolean
isPersisted()
boolean
isPerUnitBasis()
boolean
isPricingDate()
boolean
isQueryable()
boolean
isSystem()
boolean
isTime()
Object
parseValue(Object value)
void
prepareAsDtoForUpdate(PersistedObjectService objService)
protected static String
resolveExpression(String internalExpr, String uomRate, String ccyRate)
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
setFormat(String format)
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
setIsDeleted(Boolean isDeleted)
protected void
setIsDeployed(Boolean isDeployed)
void
setIsDimension(boolean isDim)
protected void
setIsKey(boolean isKey)
void
setIsPartitioningKey(boolean isPartitioningKey)
protected void
setIsPersisted(Boolean isPersisted)
void
setIsQueryable(Boolean isQueryable)
protected void
setIsTime(boolean isTime)
void
setLabel(String label)
void
setLabel(Msg i18nLabelFormat, Object... args)
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
setName(String name)
protected void
setOwningFC(String owningFC)
protected void
setOwningFC(DMFieldCollection owningFC)
void
setRank(int rank)
protected void
setSource(String sourceName)
void
setSource(DMFieldCollection source)
void
setSource(DMQuery query)
void
setSourceField(String sourceField)
void
setType(DataType dataType)
void
setType(FieldType type)
protected void
setUomField(String uomField)
void
setVisibility(Integer visibility)
String
toString()
String
toStringExt()
static FieldType
toType(DataType dataType)
protected void
update(DMField otherField)
-
-
-
Field Detail
-
SYSTEM
public static final String SYSTEM
- See Also:
- Constant Field Values
-
WILDCARD
public static final String WILDCARD
- See Also:
- Constant Field Values
-
-
Method Detail
-
copy
public DMField copy()
-
update
protected void update(DMField otherField)
-
getName
public String getName()
- Specified by:
getName
in interfaceDMExpression.DMVariable
-
setName
protected void setName(String name)
-
getEntity
public DMEntityMap.DMEntity getEntity()
- Specified by:
getEntity
in interfaceDMEntityMap.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 interfaceDMExpression.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 interfaceDMExpression.DMVariable
-
setType
public void setType(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 interfaceDMEntityMap.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 interfaceDMEntityMap.DMEntityField
-
setIsKey
protected void setIsKey(boolean isKey)
-
isPartitioningKey
public boolean isPartitioningKey()
- Specified by:
isPartitioningKey
in interfaceDMEntityMap.DMEntityField
-
setIsPartitioningKey
public void setIsPartitioningKey(boolean isPartitioningKey)
- Specified by:
setIsPartitioningKey
in interfaceDMEntityMap.DMEntityField
-
isTime
public boolean isTime()
- Specified by:
isTime
in interfaceDMExpression.DMVariable
-
setIsTime
protected void setIsTime(boolean isTime)
-
isCalendarField
public boolean isCalendarField()
-
getExpression
public String getExpression()
- Specified by:
getExpression
in interfaceDMEntityMap.DMEntityField
- Specified by:
getExpression
in interfaceDMExpression.DMVariable
-
setExpression
public void setExpression(String expression)
-
isCalculated
public boolean isCalculated()
- Specified by:
isCalculated
in interfaceDMEntityMap.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 interfaceDMEntityMap.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 interfaceDMExpression.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 interfaceDMExpression.DMVariable
-
setDefaultValue
public void setDefaultValue(Object defaultValue)
-
getSource
public String getSource()
-
setSource
protected void setSource(String sourceName)
-
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 interfaceDMEntityMap.DMEntityField
-
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 interfaceDMEntityMap.DMEntityField
-
setDbColumn
public void setDbColumn(String column)
- Specified by:
setDbColumn
in interfaceDMEntityMap.DMEntityField
-
getDbTable
public String getDbTable()
- Specified by:
getDbTable
in interfaceDMEntityMap.DMEntityField
-
setDbTable
public void setDbTable(String table)
- Specified by:
setDbTable
in interfaceDMEntityMap.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 nevernull
.- Specified by:
getValue
in interfaceVariable
- Returns:
- the variable contents. Supported return types are
String
,Integer
andDouble
.
-
parseValue
public Object parseValue(Object value)
- Specified by:
parseValue
in interfaceDMEntityMap.DMEntityField
-
isAssignable
public boolean isAssignable(Object value)
- Specified by:
isAssignable
in interfaceDMEntityMap.DMEntityField
-
addValidationError
protected void addValidationError(ValidationVisitor vv, String localizedMessage)
-
addValidationError
protected void addValidationError(ValidationVisitor vv, String attribute, String localizedMessage)
-
addValidationErrors
protected void addValidationErrors(ValidationVisitor vv, String attribute, Map<String,List<String>> validationErrors)
-
toStringExt
public String toStringExt()
-
prepareAsDtoForUpdate
public void prepareAsDtoForUpdate(PersistedObjectService objService)
-
-