Package org.faktorips.runtime.model.type
Class Formula
java.lang.Object
org.faktorips.runtime.model.type.ModelElement
org.faktorips.runtime.model.type.TypePart
org.faktorips.runtime.model.type.Formula
Represents a formula in a
ProductCmptType.- Since:
- 24.7
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the formula.getFormulaText(IProductComponent productComponent, Calendar effectiveDate) Returns the formula text of this formula in the given product component.booleanChecks whether this part is changing over time (resides in the generation) or not (resides in the product component).booleanvoidsetFormulaText(IProductComponentGeneration generation, String formulaText) Sets the formula text of this formula in the given product component.voidsetFormulaText(IProductComponent productComponent, Calendar effectiveDate, String formulaText) Sets the formula text of this formula in the given product component.toString()voidvalidate(MessageList list, IValidationContext context, IProductComponent productComponent, Calendar effectiveDate) Validates this part's configuration in the given product against the model.Methods inherited from class org.faktorips.runtime.model.type.TypePart
getMessageHelper, getMessageKey, getModelType, getType, getTypeNameMethods inherited from class org.faktorips.runtime.model.type.ModelElement
createMessageHelper, getDeprecation, getDescription, getDocumentation, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRelevantProductObject, getRelevantProductObject, invokeField, invokeMethod, isDeprecated
-
Field Details
-
MSGCODE_REQUIRED_FORMULA_IS_EMPTY
- See Also:
-
MSGKEY_REQUIRED_FORMULA_IS_EMPTY
- See Also:
-
PROPERTY_REQUIRED_FORMULA
- See Also:
-
-
Constructor Details
-
Formula
-
-
Method Details
-
isChangingOverTime
public boolean isChangingOverTime()Description copied from class:TypePartChecks whether this part is changing over time (resides in the generation) or not (resides in the product component).- Specified by:
isChangingOverTimein classTypePart- Returns:
- whether this association is changing over time
-
getFormulaText
public String getFormulaText(IProductComponent productComponent, @CheckForNull Calendar effectiveDate) Returns the formula text of this formula in the given product component.- Parameters:
productComponent- a product component based on the product component type this formula belongs to.effectiveDate- (optional) the date to use for selecting the product component's generation, if this formulaisChangingOverTime()
-
setFormulaText
public void setFormulaText(IProductComponent productComponent, @CheckForNull Calendar effectiveDate, String formulaText) Sets the formula text of this formula in the given product component.- Parameters:
productComponent- a product component based on the product component type this formula belongs to.effectiveDate- (optional) the date to use for selecting the product component's generation, if this formulaisChangingOverTime()formulaText- the new formula text
-
setFormulaText
Sets the formula text of this formula in the given product component.If the formula is not changing over time, the underlying product component is used directly; otherwise, the given generation is used.
- Parameters:
generation- the product component generation to base the formula text update onformulaText- the new formula text- Since:
- 25.1
-
getFormulaName
Returns the name of the formula. -
isRequired
public boolean isRequired()- Returns:
trueif the formula is required,falseotherwise- Since:
- 25.1
-
toString
- Overrides:
toStringin classModelElement
-
validate
public void validate(MessageList list, IValidationContext context, IProductComponent productComponent, Calendar effectiveDate) Description copied from class:TypePartValidates this part's configuration in the given product against the model.- Overrides:
validatein classTypePart- Parameters:
list- aMessageList, to which validation messages may be addedcontext- theIValidationContext, needed to determine theLocalein which to createMessagesproductComponent- theIProductComponentto validateeffectiveDate- the date that determines whichIProductComponentGenerationis to be validated, if theIProductComponenthas any and this partis changing over time
-