Class Attribute

Direct Known Subclasses:
PolicyAttribute, ProductAttribute

public abstract class Attribute extends TypePart
A Attribute represents an attribute from a PolicyCmptType or a ProductCmptType.
  • Constructor Details

  • 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:
      true if the attribute is changing over time, false if not
    • isProductRelevant

      public abstract boolean isProductRelevant()
      Returns true if this attribute is configured by the product. Product attributes are always product relevant.
      Returns:
      true if this attribute is configured by the product, false if not
    • getDatatype

      public Class<?> getDatatype()
      Returns the data type of this attribute.
      Returns:
      the attribute's datatype Class
    • getAttributeKind

      public AttributeKind getAttributeKind()
      Returns the possible kinds of this attribute.
      Returns:
      the kind of attribute
    • getValueSetKind

      public ValueSetKind getValueSetKind()
      Returns the ValueSetKind of this attribute.
      Returns:
      the kind of value set restricting this attribute
    • isOverriding

      public boolean isOverriding()
      Returns true if this attribute overrides another attribute. That means a supertype declares an attribute with the same name.
      Returns:
      true if this attribute overrides another, false if not
      See Also:
    • getSuperAttribute

      public Attribute getSuperAttribute()
      Returns the attribute that is overridden by this attribute if this attribute overrides another one. Otherwise returns null.
      Returns:
      The attribute that is overridden by this attribute.
      See Also:
    • findSuperAttribute

      public Optional<Attribute> findSuperAttribute()
      Returns the attribute that is overridden by this attribute if this attribute overrides another one. Otherwise returns null.
      Returns:
      The attribute that is overridden by this attribute.
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class ModelElement
    • createOverwritingAttributeFor

      public abstract Attribute createOverwritingAttributeFor(Type subType)
      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 Attribute for the given sub model type
    • getRelevantProductObject

      protected Object getRelevantProductObject(IProductComponent productComponent, Calendar effectiveDate)
    • getDocumentation

      protected String getDocumentation(Locale locale, DocumentationKind type, String fallback)
      Overrides:
      getDocumentation in class ModelElement