Class EnumerationInfo
java.lang.Object
com.ptc.core.lwc.common.dynamicEnum.EnumerationInfo
This class represents an enumeration. It contains both the properties of the enumeration
as well as it's entries.
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 StringDefines whether or not the entries of the enumeration should automatically be sorted alphabetically.static final StringDefines which locale's localized value would be used for the master text field if this was a static enumeration defined in the Enumeration Manager client.static final StringThe description of the enumeration.static final StringThe display name of the enumeration.static final StringThe tooltip of the enumeration. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an enumeration entry into this enumeration info.voidaddEnumerationEntryInfos(Set<EnumerationEntryInfo> entries) Add an enumeration entries set into this enumeration info.Return all enumeration entries hold by this enumeration info.Get all localizable property names that have values defined for this EnumerationInfo.getLocalizablePropertyValue(String propertyName, Locale locale) Given the property name and local, return the localizable property value.Get all non-localizable property names that have values defined for this EnumerationInfo.getNonLocalizablePropertyValue(String propertyName) Given the property name, return the non-localizable 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 of the enumeration. This is a localizable property. This is not currently displayed anywhere.
Supported API: true- See Also:
-
DESCRIPTION
The description of the enumeration. This is a localizable property. This is not currently displayed anywhere.
Supported API: true- See Also:
-
TOOLTIP
The tooltip of the enumeration. This is a localizable property. This is not currently displayed anywhere.
Supported API: true- See Also:
-
DEFAULT_LOCALE
Defines which locale's localized value would be used for the master text field if this was a static enumeration defined in the Enumeration Manager client. The master text value is used in certain situations when a localized value for a given locale has not been specified. This is a non-localizable property. The value for this key should be a Locale. If this property is not set, the server locale will be used.
Supported API: true- See Also:
-
AUTO_SORT
Defines whether or not the entries of the enumeration should automatically be sorted alphabetically. If this property is set to true, then theEnumerationEntryInfo.SORT_ORDERproperty on the enumeration entries will be ignored. If this property is set to false, then the entries will be sorted according to theirEnumerationEntryInfo.SORT_ORDER. 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 false.
Supported API: true- See Also:
-
-
Method Details
-
getLocalizablePropertyNames
Get all localizable property names that have values defined for this EnumerationInfo.
Supported API: true- Returns:
- Set
-
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
-
getNonLocalizablePropertyNames
Get all non-localizable property names that have values defined for this EnumerationInfo.
Supported API: true- Returns:
- all non localizable property names.
-
getNonLocalizablePropertyValue
Given the property name, return the non-localizable property value. Null is returned when there is no such property value.
Supported API: true- Parameters:
propertyName-- Returns:
- The non localizable property value. Null is returned if there is no such 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. i.e. Locale value object forDEFAULT_LOCALEproperty, Boolean value object forAUTO_SORTproperty.- 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.
-
getEnumerationEntryInfos
Return all enumeration entries hold by this enumeration info.
Supported API: true- Returns:
- All enumeration entries
-
addEnumerationEntryInfo
Add an enumeration entry into this enumeration info. If an enumeration entry with the same name already exists, that entry will be replaced.
Supported API: true- Parameters:
entry- The enumeration entry. It must not be null.- Throws:
IllegalArgumentException- This exception is thrown when the given entry is null.
-
addEnumerationEntryInfos
Add an enumeration entries set into this enumeration info. If an enumeration entry with the same name already exists, that entry will be replaced.
Supported API: true- Parameters:
entries- The enumeration entries set. It must not be null.- Throws:
IllegalArgumentException- This exception is thrown when the given entries parameter is null.
-