Class Attribute

All Implemented Interfaces:
Serializable, IBaseEntity, ICollectionManaged, ICoreEntity, IEntity, IRightManaged, ISortableEntity, IStateManaged, ITypeManaged, IVersionManaged

@Entity public class Attribute extends ComplexEntity implements IRightManaged, ICollectionManaged, IStateManaged, IVersionManaged
Attributes carry most of the information of complex entities, which make up their characteristics. An Attribute is used to define a feature and is assigned to an complex entity. Usually the feature has a value or values which will be added to the assignment. Except for territory dependent Attributes an Attribute can be assigned to a ComplexEntity only once.
Most fields of an Attribute serve to define the value(s) in order to make editing of the feature described by this Attribute simpler and less prone to error.
Some properties with regard to defining the value(s):
  • dataTypeForValue:
  • mandatory except for Attributes whose AttributeType is of subtype OBJECTS_STATIC
  • enumeration: if true values of the Attribute can only be selected, not freely added. The predefined values are stored in list standardValues
  • multivalue:
  • if true Attribute can have more than one value
  • allowedUnits:
  • optional, only use if dataTypeForValue allows for unit(s) in value. Narrow down the choice of possible units.
  • minSizeForValue:
  • for text values the minimum size of allowed text, for numeric values the minimum value, used in validation of value
  • maxSizeForValue:
  • for text values the maximum size of allowed text, for numeric values the maximum value, used in validation of value
  • territoryDependent:
  • if true the Attribute can be assigned for each active territory and have a value/values
Attributes themselves are ComplexEntities and have a type, the AttributeType, used to configure the Attribute. There is a set of built in subtypes for AttributeTypes, that define in which roles the Attributes are used:
  • TYPES: type attributes, the list of these Attributes is set by type of ComplexEntity and the same for all ComplexEntities of this type. The Attribute is only assigned to ComplexEntity when it has a value, when the value is removed also the assignment is removed.
  • OBJECTS_VALUE: Attributes that can be assigned to ComplexEntity freely by the user and have values. AllowedAttributeTypes in ComplexEntityType constrain the choice of Attributes to be assigned.
  • PRESENTATION: used as parameters to fine tune publication
  • OBJECTS_STATIC: Attributes without a value, that are used as text blocks. The name of the Attribute holds the text.
By default an Attribute stands alone, but it is possible to created grouped Attributes. The group itself is defined by the parent Attribute, which is assigned as type attribute in configuration if AttributeType has subType TYPES. Howerver, it has no dataTypeForValue and no Value, although having a TYPES- or OBJECTS_VALUE-AttributeType.
It has a list of children that have values and are assigned to complexEntities. Such a group of Attributes can be assigned to a complexentity several times. enum attributeGroup must be set depending on the role of an Attribute in an attribute group:
  • NONE: default, no attribute group
  • PARENT: the parent that defines the group
  • CHILD: a child Attribute in the group
  • See Also:
    • Field Details

      • FLAG_REASSIGN_DATAVALUES

        public static final int FLAG_REASSIGN_DATAVALUES
        BIT FIELD FLAGS (the first 5 reserved or used for complex entity)
        migrate data value (DVASset type) assignment by add new version/remove last version
        See Also:
    • Constructor Details

      • Attribute

        public Attribute()
      • Attribute

        public Attribute(Attribute source)
    • Method Details

      • isMultivalue

        public boolean isMultivalue()
      • setMultivalue

        public void setMultivalue(boolean isMultivalue)
      • isEnumeration

        public boolean isEnumeration()
      • setEnumeration

        public void setEnumeration(boolean isEnumeration)
      • isReadonly

        public boolean isReadonly()
        Returns:
        true if this attribute is read-only from a user perspective. API calls are not affected by this setting.
      • setReadonly

        public void setReadonly(boolean isReadonly)
        Parameters:
        isReadonly - true to make this attribute read-only from a user perspective. API calls are not restricted by this setting.
      • isSearchable

        public boolean isSearchable()
      • setSearchable

        public void setSearchable(boolean isSearchable)
      • isFacetable

        public boolean isFacetable()
        tells if this attribute be used by faceted-search
        Returns:
        boolean
      • setFacetable

        public void setFacetable(boolean facetable)
        to allow this attribute for faceted-search
      • isInheritable

        public boolean isInheritable()
        tells if the Attribute can be inherited when assigned to a ComplexEntities that is a HrcEntity. If yes Attribute will be displayed also in offspring, without being assigned itself. Only when child overwrites the value will the Attribute get assigned.
        Returns:
        boolean
      • setInheritable

        public void setInheritable(boolean isInheritable)
      • isTerritoryDependent

        public boolean isTerritoryDependent()
      • setTerritoryDependent

        public void setTerritoryDependent(boolean territoryDependent)
      • getAllowedUnits

        public List<Unit> getAllowedUnits()
      • setAllowedUnits

        public void setAllowedUnits(List<Unit> allowedUnits)
      • getDataTypeForValue

        public DataType getDataTypeForValue()
      • setDataTypeForValue

        public void setDataTypeForValue(DataType dataTypeForValue)
      • getStandardValues

        public List<DataValueSet> getStandardValues()
      • setStandardValues

        public void setStandardValues(List<DataValueSet> standardValues)
      • getDefaultValues

        public DataValueSet getDefaultValues()
      • setDefaultValues

        public void setDefaultValues(DataValueSet defaultValues)
      • getSampleValues

        public DataValueSet getSampleValues()
      • setSampleValues

        public void setSampleValues(DataValueSet sampleValues)
      • getAttributeType

        public AttributeType getAttributeType()
      • setAttributeType

        public void setAttributeType(AttributeType attributeType)
      • setType

        public void setType(ComplexTypeEntity type)
        Description copied from class: ComplexEntity
        override in derived classes if ComplexEntity-subclass is type managed, else do nothing.
        be used by entity mapper
        Overrides:
        setType in class ComplexEntity
      • getMaxSizeForValue

        public Integer getMaxSizeForValue()
        Returns:
        Maximum number of characters of value for texts. Maximum value for numbers.
      • setMaxSizeForValue

        public void setMaxSizeForValue(Integer maxSizeForValue)
        Parameters:
        maxSizeForValue - Maximum number of characters of value for texts. Maximum value for numbers.
      • getMinSizeForValue

        public Integer getMinSizeForValue()
        Returns:
        Minimum number of characters of value for texts. Minimum value for numbers.
      • setMinSizeForValue

        public void setMinSizeForValue(Integer minSizeForValue)
        Parameters:
        minSizeForValue - Minimum number of characters of value for texts. Minimum value for numbers.
      • getAllowedPattern

        public String getAllowedPattern()
      • setAllowedPattern

        public void setAllowedPattern(String allowedPattern)
      • isTypeAttribute

        @Deprecated public boolean isTypeAttribute()
        Deprecated.
      • isConfigType

        @Deprecated public boolean isConfigType()
        Deprecated.
      • getDefaultValue

        public DataValue getDefaultValue(Locale locale)
        Parameters:
        locale - Locale if Datatype is locale dependent, is ignored for locale independent Datatypes (can be null)
        Returns:
        default DataValue for given locale if exist and if datavalue is locale dependent, for locale independent returns the first datavalue if exist, otherwise null
      • getSampleValue

        public DataValue getSampleValue(Locale locale)
        Parameters:
        locale - Locale if Datatype is locale dependent, is ignored for locale independent Datatypes (can be null)
        Returns:
        sample DataValue for given locale if exist and if datavalue is locale dependent, for locale independent returns the first datavalue if exist, otherwise null
      • isPresentationAttribute

        public boolean isPresentationAttribute()
      • getHasObjectRights

        public boolean getHasObjectRights()
        Description copied from class: ComplexEntity
        type of ComplexEntity must be attached if exists
        Specified by:
        getHasObjectRights in interface IRightManaged
        Overrides:
        getHasObjectRights in class ComplexEntity
        Returns:
        true if object rights are configured for this ComplexEntity
      • getStateGroupTypes

        public List<StateGroupType> getStateGroupTypes()
        Description copied from class: ComplexEntity
        type of ComplexEntity must be attached
        Specified by:
        getStateGroupTypes in interface IStateManaged
        Overrides:
        getStateGroupTypes in class ComplexEntity
        Returns:
        List of StateGroupType configured for this ComplexEntity, is no type of nothing configured empty list
      • getType

        public ComplexTypeEntity getType()
        Description copied from class: ComplexEntity
        override in derived classes, return null if ComplexEntity-subclass is not type managed.
        Specified by:
        getType in interface ICollectionManaged
        Specified by:
        getType in interface ITypeManaged
        Specified by:
        getType in class ComplexEntity
      • isRootPerType

        public boolean isRootPerType()
        Description copied from interface: ICollectionManaged
        Flag that indicates if the entities have a root collection per type or if there is only one global root collection. if rootPerType true it can only apply to entities that have a type, i.e. ComplexEntities.
        Specified by:
        isRootPerType in interface ICollectionManaged
      • getAllowedRightTypes

        public RightType[] getAllowedRightTypes()
        Description copied from interface: IRightManaged
        give the maximum list of RightTypes that apply for this class.
        Specified by:
        getAllowedRightTypes in interface IRightManaged
        Returns:
        array of enum RightType
      • isSearchRelevant

        public boolean isSearchRelevant()
      • getInternalDescription

        public String getInternalDescription()
        Specified by:
        getInternalDescription in interface IEntity
        Overrides:
        getInternalDescription in class ComplexEntity
        Returns:
        Unique identifier in combination with entity class if internalDescription property is defined as unique. Might be null.
      • hasStandardValues

        public boolean hasStandardValues()
      • isReassignDataValues

        public boolean isReassignDataValues()
      • setReassignDataValues

        public void setReassignDataValues(boolean migrate)