Class EnumerationEntryInfo
java.lang.Object
com.ptc.core.lwc.common.dynamicEnum.EnumerationEntryInfo
This class represents an enumeration entry. It contains the properties of the enumeration entry.
There is a unique name for each enumeration entry.
This class is not thread safe and should not be modified after handing it off to other code.
Note: All localizable properties should be get/set using
Note: For all non-localizable properties, if the datatype does not match the documented datatype an error will be logged and an empty enumeration will be used.
Supported API: true
Extendable: false
Note: All localizable properties should be get/set using
getLocalizablePropertyValue(java.lang.String, java.util.Locale) and
setLocalizableProperty(java.lang.String, java.util.Locale, java.lang.String). All non-localizable properties should be get/set using
getNonLocalizablePropertyValue(java.lang.String) and setNonLocalizableProperty(java.lang.String, java.lang.Object).
Note: For all non-localizable properties, if the datatype does not match the documented datatype an error will be logged and an empty enumeration will be used.
Supported API: true
Extendable: false
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe description for the enumeration entry.static final StringThe display name for the enumeration entry.static final StringDefines whether or not the entry should be selectable.static final StringDefines the sort order for the enumeration entry.static final StringThe tooltip for the enumeration entry. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet all localizable property names that have values defined for this EnumerationEntryInfo.getLocalizablePropertyValue(String propertyName, Locale locale) Given the property name and local, return the localizable property value.getName()Get the name of this enumeration entry
Supported API: trueGet all non-localizable property names that have values defined for this EnumerationEntryInfo.getNonLocalizablePropertyValue(String propertyName) Given the property name, return the property value.voidsetLocalizableProperty(String propertyName, Locale locale, String value) Set the localizable property value based on the given property name, locale and value.voidsetNonLocalizableProperty(String propertyName, Object value) Set the non localizable property value based on the given property name and value.
-
Field Details
-
DISPLAY_NAME
The display name for the enumeration entry. This a the localizable property.
Supported API: true- See Also:
-
DESCRIPTION
The description for the enumeration entry. This is a localizable property.
Supported API: true- See Also:
-
TOOLTIP
The tooltip for the enumeration entry. This is a localizable property.
Supported API: true- See Also:
-
SELECTABLE
Defines whether or not the entry should be selectable. This is a non-localizable property. The value for this key should be a Boolean. If this property is not set, it will default to true.
Supported API: true- See Also:
-
SORT_ORDER
Defines the sort order for the enumeration entry. (lowest to highest) Ignored ifEnumerationInfo.AUTO_SORTis true on the enumeration. This is a non-localizable property. The value for this key should be an Integer. If this property is not set, it will default toInteger.MAX_VALUE/2.
Supported API: true- See Also:
-
-
Constructor Details
-
EnumerationEntryInfo
Constructor
Supported API: true- Parameters:
entryKey- The name of the enumeration entry. Only letters, numbers, '.', and '_' characters are allowed.- Throws:
IllegalArgumentException- This exception is thrown when the given entryKey is null or an empty string.
-
-
Method Details
-
getName
Get the name of this enumeration entry
Supported API: true- Returns:
-
getNonLocalizablePropertyNames
Get all non-localizable property names that have values defined for this EnumerationEntryInfo.
Supported API: true- Returns:
- Set
-
getLocalizablePropertyNames
Get all localizable property names that have values defined for this EnumerationEntryInfo.
Supported API: true- Returns:
- Set
-
getNonLocalizablePropertyValue
Given the property name, return the property value. Null is returned when there is no such property value.
Supported API: true- Parameters:
propertyName-- Returns:
- A property value
-
getLocalizablePropertyValue
Given the property name and local, return the localizable property value. Null is returned when there is no such property value.
Supported API: true- Parameters:
propertyName-locale-- Returns:
- A localizable property value
-
setNonLocalizableProperty
Set the non localizable property value based on the given property name and value. When a null value is given, the original property value is removed.
Supported API: true- Parameters:
propertyName- The non localizable property name. It must not be null.value- The non localizable property value. If the null value is given, the original property value is removed. This none-null value object must match the datatype of the given property name specified.- Throws:
IllegalArgumentException- This exception is thrown when the given propertyName is null or an empty string. When the property value object datatype doesn't match the property name specified, this exception also is thrown.
-
setLocalizableProperty
Set the localizable property value based on the given property name, locale and value. When a null value is given, the original property value is removed.
Supported API: true- Parameters:
propertyName- The localizable property. It must not be null.locale- The locale for this given localizable property value. It must not be null.value- The localizable property value. It the null value is given, the original property value is removed.- Throws:
IllegalArgumentException- This exception is thrown when the given name or the given locale is null, or the given name is an empty string.
-