Package org.faktorips.runtime.model.type
Class Attribute
java.lang.Object
org.faktorips.runtime.model.type.ModelElement
org.faktorips.runtime.model.type.TypePart
org.faktorips.runtime.model.type.Attribute
- Direct Known Subclasses:
PolicyAttribute,ProductAttribute
A
Attribute represents an attribute from a PolicyCmptType or a ProductCmptType.-
Constructor Summary
ConstructorsConstructorDescriptionAttribute(Type type, IpsAttribute attributeAnnotation, IpsExtensionProperties extensionProperties, Class<?> datatype, boolean changingOverTime, Optional<Deprecation> deprecation) -
Method Summary
Modifier and TypeMethodDescriptionabstract AttributecreateOverwritingAttributeFor(Type subType) Creates an attribute model for a sub type in which this attribute is overwritten.Returns the attribute that is overridden by this attribute if this attribute overrides another one.Returns the possible kinds of this attribute.Class<?>Returns the data type of this attribute.protected ObjectgetRelevantProductObject(IProductComponent productComponent, Calendar effectiveDate) Returns the attribute that is overridden by this attribute if this attribute overrides another one.Returns theValueSetKindof this attribute.booleanReturns true if this attribute is changing over time.booleanReturnstrueif this attribute overrides another attribute.abstract booleanReturns true if this attribute is configured by the product.toString()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, invokeField, invokeMethod, isDeprecated
-
Constructor Details
-
Attribute
public Attribute(Type type, IpsAttribute attributeAnnotation, IpsExtensionProperties extensionProperties, Class<?> datatype, boolean changingOverTime, Optional<Deprecation> deprecation)
-
-
Method Details
-
isChangingOverTime
public boolean isChangingOverTime()Returns true if this attribute is changing over time. For product attribute that means the attribute resides in the generation. For policy attributes the optional product configuration resides in the generation.- Returns:
trueif the attribute is changing over time,falseif not
-
isProductRelevant
public abstract boolean isProductRelevant()Returns true if this attribute is configured by the product. Product attributes are always product relevant.- Returns:
trueif this attribute is configured by the product,falseif not
-
getDatatype
Returns the data type of this attribute.- Returns:
- the attribute's datatype
Class
-
getAttributeKind
Returns the possible kinds of this attribute.- Returns:
- the kind of attribute
-
getValueSetKind
Returns theValueSetKindof this attribute.- Returns:
- the kind of value set restricting this attribute
-
isOverriding
public boolean isOverriding()Returnstrueif this attribute overrides another attribute. That means a supertype declares an attribute with the same name.- Returns:
trueif this attribute overrides another,falseif not- See Also:
-
getSuperAttribute
Returns the attribute that is overridden by this attribute if this attribute overrides another one. Otherwise returnsnull.- Returns:
- The attribute that is overridden by this attribute.
- See Also:
-
findSuperAttribute
Returns the attribute that is overridden by this attribute if this attribute overrides another one. Otherwise returnsnull.- Returns:
- The attribute that is overridden by this attribute.
- See Also:
-
toString
- Overrides:
toStringin classModelElement
-
createOverwritingAttributeFor
Creates an attribute model for a sub type in which this attribute is overwritten. This is necessary to retrieve information contained in the class annotation such as labels if no getter is generated for the overwritten attribute in the sub class.- Parameters:
subType- a model type representing a sub type of this attribute's model type- Returns:
- a
Attributefor the given sub model type
-
getRelevantProductObject
protected Object getRelevantProductObject(IProductComponent productComponent, Calendar effectiveDate)
-