public abstract class PolicyAttribute extends Attribute
PolicyCmptType.IModelTypeAttribute.AttributeType, IModelTypeAttribute.ValueSetType| Constructor and Description |
|---|
PolicyAttribute(Type type,
IpsAttribute attributeAnnotation,
IpsExtensionProperties extensionProperties,
Class<?> datatype,
boolean changingOverTime) |
| Modifier and Type | Method and Description |
|---|---|
abstract Object |
getDefaultValue(IConfigurableModelObject modelObject)
Returns the product configured default value of the attribute identified by this model type
attribute.
|
abstract Object |
getDefaultValue(IProductComponent source,
Calendar effectiveDate)
Returns the product configured default value of the attribute identified by this model type
attribute.
|
PolicyCmptType |
getModelType()
Deprecated.
Use
getType() |
PolicyAttribute |
getSuperAttribute()
Returns the attribute that is overridden by this attribute if this attribute overrides
another one.
|
PolicyCmptType |
getType()
Returns the
PolicyCmptType this attribute belongs to. |
abstract Object |
getValue(IModelObject modelObject)
Returns the value of the given model object's attribute identified by this model type
attribute.
|
org.faktorips.valueset.ValueSet<?> |
getValueSet(IModelObject modelObject)
Returns the value set of the given model object's attribute identified by this model type
attribute.
|
abstract org.faktorips.valueset.ValueSet<?> |
getValueSet(IModelObject modelObject,
IValidationContext context)
Returns the value set of the given model object's attribute identified by this model type
attribute.
|
org.faktorips.valueset.ValueSet<?> |
getValueSet(IProductComponent source,
Calendar effectiveDate)
Returns the value set of the given model object's attribute identified by this model type
attribute.
|
abstract org.faktorips.valueset.ValueSet<?> |
getValueSet(IProductComponent source,
Calendar effectiveDate,
IValidationContext context)
Returns the value set of the given model object's attribute identified by this model type
attribute.
|
abstract void |
setValue(IModelObject modelObject,
Object value)
Sets the given model object's attribute identified by this model type attribute to the given
value.
|
createOverwritingAttributeFor, getAttributeKind, getAttributeType, getDatatype, getRelevantProductObject, getValueSetKind, getValueSetType, isChangingOverTime, isOverriding, isProductRelevant, toStringgetMessageHelper, getMessageKey, getTypeNamecreateMessageHelper, getDescription, getDocumentation, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRelevantProductObject, invokeField, invokeMethodclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getNamepublic PolicyAttribute(Type type, IpsAttribute attributeAnnotation, IpsExtensionProperties extensionProperties, Class<?> datatype, boolean changingOverTime)
public PolicyCmptType getType()
PolicyCmptType this attribute belongs to.@Deprecated public PolicyCmptType getModelType()
getType()TypegetModelType in interface IModelTypeAttributegetModelType in class TypePartpublic PolicyAttribute getSuperAttribute()
Attributenull.getSuperAttribute in class AttributeAttribute.isOverriding()public abstract Object getValue(IModelObject modelObject)
modelObject - a model object corresponding to the Type this attribute belongs toIllegalArgumentException - if the model object does not have an attribute fitting this
model type attribute or that attribute is not accessible for any reasonpublic abstract void setValue(IModelObject modelObject, Object value)
modelObject - a model object corresponding to the Type this attribute belongs tovalue - an object of this model type attribute's datatypeIllegalArgumentException - if the model object does not have a changeable attribute
fitting this model type attribute or that attribute is not accessible for any
reason or the value does not fit the attribute's datatype.UnsupportedOperationException - if invoked on a
AttributeKind.CONSTANT attribute.public abstract Object getDefaultValue(IConfigurableModelObject modelObject)
IllegalArgumentException if the model object has no
getDefaultValue() method for this attribute. This also occurs if the corresponding policy
class is not configured by a product class.modelObject - the configurable model object from which product component and (if
necessary) effective date can be retrievedgetDefaultValue(IProductComponent, Calendar)public abstract Object getDefaultValue(IProductComponent source, Calendar effectiveDate)
IllegalArgumentException if the model object has no
getDefaultValue() method for this attribute. This also occurs if the corresponding policy
class is not configured by a product class.source - the product component to read the attribute default value from.effectiveDate - the date to determine the product component generation. If
null the latest generation is used. Is ignored if the attribute's
configuration is not changing over time.UnsupportedOperationException - if invoked on a
AttributeKind.CONSTANT attribute.public abstract org.faktorips.valueset.ValueSet<?> getValueSet(IModelObject modelObject, IValidationContext context)
Note: If the PolicyCmptType this PolicyAttribute belongs to defines
an UnrestrictedValueSet including null, no method is generated by
Faktor-IPS. Therefore, a value set method in a subclass is not found even if the
IModelObject passed to this method is an instance of that subclass. To make sure to
get the correct value set, always use IpsModel.getPolicyCmptType(IModelObject) on the
actual IModelObject instead of IpsModel.getPolicyCmptType(Class) on the super
class.
modelObject - a model objectpublic org.faktorips.valueset.ValueSet<?> getValueSet(IModelObject modelObject)
Note: If the PolicyCmptType this PolicyAttribute belongs to defines
an UnrestrictedValueSet including null, no method is generated by
Faktor-IPS. Therefore, a value set method in a subclass is not found even if the
IModelObject passed to this method is an instance of that subclass. To make sure to
get the correct value set, always use IpsModel.getPolicyCmptType(IModelObject) on the
actual IModelObject instead of IpsModel.getPolicyCmptType(Class) on the super
class.
IValidationContext.modelObject - a model objectUnsupportedOperationException - if invoked on a
AttributeKind.CONSTANT attribute.public abstract org.faktorips.valueset.ValueSet<?> getValueSet(IProductComponent source, Calendar effectiveDate, IValidationContext context)
IllegalArgumentException if the model object has no
getAllowedValues() method for this attribute. This also occurs if the corresponding policy
class is not configured by a product class.source - the product component to read an attribute value set from. Must correspond to
the Type this attribute belongs to.effectiveDate - the date to determine the product component generation. If
null the latest generation is used. Is ignored if the attribute's
configuration is not changing over time.UnsupportedOperationException - if invoked on a
AttributeKind.CONSTANT attribute.public org.faktorips.valueset.ValueSet<?> getValueSet(IProductComponent source, Calendar effectiveDate)
IllegalArgumentException if the model object has no
getAllowedValues() method for this attribute. This also occurs if the corresponding policy
class is not configured by a product class.
This method uses a default IValidationContext.
source - the product component to read an attribute value set from. Must correspond to
the Type this attribute belongs to.effectiveDate - the date to determine the product component generation. If
null the latest generation is used. Is ignored if the attribute's
configuration is not changing over time.UnsupportedOperationException - if invoked on a
AttributeKind.CONSTANT attribute.Copyright © 2020. All rights reserved.