Package com.mayam.wf.attributes.shared
Class ManagedEnums
java.lang.Object
com.mayam.wf.attributes.shared.ManagedEnums
Provides access to objects of enumerations used as value classes for attributes using
class literal and either full or compact name. Originally created mainly to work around
missing reflection support in the Google Web Toolkit (no longer in use).
- Author:
- Markus MÃ¥rtensson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ManagedEnum
Retrieves anManagedEnum
value based on its class andManagedEnum.compact()
name.static ManagedEnum
Retrieves anManagedEnum
value based on its class andEnum.name()
.static ManagedEnum
byNameOrCompact
(Class<?> valueClass, String nameOrCompact) Retrieves anManagedEnum
value based on its class andManagedEnum.compact()
name or regular ManagedEnum#name().static boolean
isManagedEnum
(Class<?> valueClass) Determines if a given valueClass is a supported ManagedEnum.Returns a set of managed enum classes.static ManagedEnum[]
Retrieves all values of aManagedEnum
given its class.
-
Constructor Details
-
ManagedEnums
public ManagedEnums()
-
-
Method Details
-
byName
Retrieves anManagedEnum
value based on its class andEnum.name()
.- Parameters:
valueClass
- enumeration class.name
- enumeration value name.- Returns:
- value.
- Throws:
IllegalArgumentException
- if the class is not a supported ManagedEnum.
-
values
Retrieves all values of aManagedEnum
given its class.- Parameters:
valueClass
- enumeration class.- Returns:
- values.
- Throws:
IllegalArgumentException
- if the class is not a supported ManagedEnum.
-
byCompact
Retrieves anManagedEnum
value based on its class andManagedEnum.compact()
name.- Parameters:
valueClass
- enumeration class.compact
- enumeration value compact name.- Returns:
- value.
-
byNameOrCompact
Retrieves anManagedEnum
value based on its class andManagedEnum.compact()
name or regular ManagedEnum#name().- Parameters:
valueClass
- enumeration class.nameOrCompact
- enumeration value compact name or regular name.- Returns:
- value.
-
isManagedEnum
Determines if a given valueClass is a supported ManagedEnum.- Parameters:
valueClass
- potential enumeration class.- Returns:
- true if supported ManagedEnum.
-
managedClasses
Returns a set of managed enum classes.
-