Class EnumAttribute
java.lang.Object
org.faktorips.runtime.model.type.ModelElement
org.faktorips.runtime.model.enumtype.EnumAttribute
Description of an attribute of an
EnumType.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static LinkedHashMap<String,EnumAttribute> createFrom(EnumType enumType, Class<?> enumClass) Class<?>The class for this attribute's values.protected StringgetDocumentation(Locale locale, DocumentationKind type, String fallback) protected MessagesHelperprotected StringgetMessageKey(DocumentationKind messageType) Returns the value for this attribute from the enum value.Returns the value for this attribute from the enum value.booleanWhether this attribute is used to display an enum value for human readability.booleanWhether this attribute is used to identify an enum value.booleanWhether this attribute's values are mandatory (no empty/nullvalues allowed).booleanWhether the values of this attribute are dependent onLocale.booleanisUnique()Whether this attribute's value is unique over all the enum's values.voidvalidate(MessageList list, IValidationContext context, Object enumValue) Validates this enum attribute's configuration in the given enum value against the model.Methods inherited from class org.faktorips.runtime.model.type.ModelElement
createMessageHelper, getDeprecation, getDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRelevantProductObject, getRelevantProductObject, invokeField, invokeMethod, isDeprecated, toString
-
Field Details
-
MSGCODE_MANDATORY_ATTRIBUTE_IS_EMPTY
- See Also:
-
MSGCODE_NOT_UNIQUE
- See Also:
-
MSGKEY_MANDATORY_ATTRIBUTE_IS_EMPTY
- See Also:
-
MSGKEY_MANDATORY_MULTILINGUAL_ATTRIBUTE_IS_EMPTY
- See Also:
-
MSGKEY_NOT_UNIQUE
- See Also:
-
-
Constructor Details
-
EnumAttribute
-
-
Method Details
-
getDatatype
The class for this attribute's values. -
isUnique
public boolean isUnique()Whether this attribute's value is unique over all the enum's values. -
isIdentifier
public boolean isIdentifier()Whether this attribute is used to identify an enum value. -
isDisplayName
public boolean isDisplayName()Whether this attribute is used to display an enum value for human readability. -
isMandatory
public boolean isMandatory()Whether this attribute's values are mandatory (no empty/nullvalues allowed). -
getValue
Returns the value for this attribute from the enum value. If the attribute is multilingual, the default Locale is used. -
isMultilingual
public boolean isMultilingual()Whether the values of this attribute are dependent onLocale. -
getValue
Returns the value for this attribute from the enum value. If the attribute is multilingual, the given locale is used, otherwise it is ignored.- See Also:
-
getMessageKey
- Specified by:
getMessageKeyin classModelElement
-
getMessageHelper
- Specified by:
getMessageHelperin classModelElement
-
createFrom
protected static LinkedHashMap<String,EnumAttribute> createFrom(EnumType enumType, Class<?> enumClass) -
findSuperEnumAttribute
-
getDocumentation
- Overrides:
getDocumentationin classModelElement
-
validate
Validates this enum attribute's configuration in the given enum value against the model. Only properties inherent to an enum value (likemandatory) are validated here, properties that can only be validated in context with other enum values likeuniqueare validated inEnumType.validate(MessageList, IValidationContext, List)(which also calls this validation for every enum value).- Parameters:
list- aMessageList, to which validation messages may be addedcontext- theIValidationContext, needed to determine theLocalein which to createMessagesenumValue- the enum value instance to validate- Since:
- 25.1
- See Also:
-