Class EnumType
java.lang.Object
org.faktorips.runtime.model.type.ModelElement
org.faktorips.runtime.model.enumtype.EnumType
Description of an enum's attributes and extensibility.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String name) Returns the model for the attribute with the given name ornullif no such attribute exists.Returns the names of all this enum's attributes.Returns models for all this enum's attributesThe model for the attribute used to display an instance of this enum in human readable form.protected StringgetDocumentation(Locale locale, DocumentationKind type, String fallback) Class<?>Returns the class this enum type represents.The qualified name an enum content extending this enum must have.The model for the attribute used to uniquely identify an instance of this enum.protected MessagesHelperprotected StringgetMessageKey(DocumentationKind messageType) static <T> List<T>getValuesFromType(Class<T> enumClass) Returns the values that are defined in the type, if any.booleanWhether the enum's values can be extended in an enum content provided in aIRuntimeRepository.toString()voidvalidate(MessageList list, IValidationContext context, Object enumValue) Validates this enum's configuration in the given enum value against the model.voidvalidate(MessageList list, IValidationContext context, List<?> enumValues) Validates this enum's configuration in the given enum values 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
-
Field Details
-
KIND_NAME
- See Also:
-
-
Constructor Details
-
EnumType
-
-
Method Details
-
isExtensible
public boolean isExtensible()Whether the enum's values can be extended in an enum content provided in aIRuntimeRepository. -
getEnumContentQualifiedName
The qualified name an enum content extending this enum must have.- See Also:
-
getAttributes
Returns models for all this enum's attributes -
getAttribute
Returns the model for the attribute with the given name ornullif no such attribute exists. -
getAttributenames
Returns the names of all this enum's attributes. -
getIdAttribute
The model for the attribute used to uniquely identify an instance of this enum. -
getDisplayNameAttribute
The model for the attribute used to display an instance of this enum in human readable form. -
getValuesFromType
Returns the values that are defined in the type, if any. Values defined in an enum content are not returned here but must be retrieved viaIRuntimeRepository.getEnumValues(Class).- Parameters:
enumClass- The class of which you want to get the enumeration values- Returns:
- A list of instances of
enumClassthat are defined as enumeration values of the specified type. - Since:
- 25.1
-
getMessageHelper
- Specified by:
getMessageHelperin classModelElement
-
getMessageKey
- Specified by:
getMessageKeyin classModelElement
-
getEnumClass
Returns the class this enum type represents. -
toString
- Overrides:
toStringin classModelElement
-
findSuperEnumType
-
getDocumentation
- Overrides:
getDocumentationin classModelElement
-
validate
Validates this enum's configuration in the given enum values against the model.- Parameters:
list- aMessageList, to which validation messages may be addedcontext- theIValidationContext, needed to determine theLocalein which to createMessagesenumValues- the enum value instances to validate- Throws:
IllegalArgumentException- if any of the given enum values does not match this enum type- Since:
- 25.1
-
validate
Validates this enum'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 only validated invalidate(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 instances to validate- Throws:
IllegalArgumentException- if the given enum value does not match this enum type- Since:
- 25.1
- See Also:
-