Class EnumAttribute
- java.lang.Object
-
- org.faktorips.runtime.model.type.ModelElement
-
- org.faktorips.runtime.model.enumtype.EnumAttribute
-
public class EnumAttribute extends ModelElement
Description of an attribute of anEnumType.
-
-
Constructor Summary
Constructors Constructor Description EnumAttribute(EnumType enumType, java.lang.String name, java.lang.reflect.Method getter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static java.util.LinkedHashMap<java.lang.String,EnumAttribute>createFrom(EnumType enumType, java.lang.Class<?> enumClass)java.lang.Class<?>getDatatype()The class for this attribute's values.protected MessagesHelpergetMessageHelper()protected java.lang.StringgetMessageKey(DocumentationKind messageType)java.lang.ObjectgetValue(java.lang.Object enumInstance)Returns the value for this attribute from the enum value.java.lang.ObjectgetValue(java.lang.Object enumInstance, java.util.Locale locale)Returns the value for this attribute from the enum value.booleanisDisplayName()Whether this attribute is used to display an enum value for human readability.booleanisIdentifier()Whether this attribute is used to identify an enum value.booleanisMultilingual()Whether the values of this attribute are dependent onLocale.booleanisUnique()Whether this attribute's value is unique over all the enum's values.-
Methods inherited from class org.faktorips.runtime.model.type.ModelElement
createMessageHelper, getDeprecation, getDescription, getDocumentation, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRelevantProductObject, invokeField, invokeMethod, isDeprecated, toString
-
-
-
-
Constructor Detail
-
EnumAttribute
public EnumAttribute(EnumType enumType, java.lang.String name, java.lang.reflect.Method getter)
-
-
Method Detail
-
getDatatype
public java.lang.Class<?> 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.
-
getValue
public java.lang.Object getValue(java.lang.Object enumInstance)
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
public java.lang.Object getValue(java.lang.Object enumInstance, java.util.Locale locale)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:
for getting a locale independent value
-
getMessageKey
protected java.lang.String getMessageKey(DocumentationKind messageType)
- Specified by:
getMessageKeyin classModelElement
-
getMessageHelper
protected MessagesHelper getMessageHelper()
- Specified by:
getMessageHelperin classModelElement
-
createFrom
protected static java.util.LinkedHashMap<java.lang.String,EnumAttribute> createFrom(EnumType enumType, java.lang.Class<?> enumClass)
-
-