Class ManagedEnums

java.lang.Object
com.mayam.wf.attributes.shared.ManagedEnums

public class ManagedEnums extends Object
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 Details

    • ManagedEnums

      public ManagedEnums()
  • Method Details

    • byName

      public static ManagedEnum byName(Class<?> valueClass, String name)
      Retrieves an ManagedEnum value based on its class and Enum.name().
      Parameters:
      valueClass - enumeration class.
      name - enumeration value name.
      Returns:
      value.
      Throws:
      IllegalArgumentException - if the class is not a supported ManagedEnum.
    • values

      public static ManagedEnum[] values(Class<?> valueClass)
      Retrieves all values of a ManagedEnum given its class.
      Parameters:
      valueClass - enumeration class.
      Returns:
      values.
      Throws:
      IllegalArgumentException - if the class is not a supported ManagedEnum.
    • byCompact

      public static ManagedEnum byCompact(Class<?> valueClass, String compact)
      Retrieves an ManagedEnum value based on its class and ManagedEnum.compact() name.
      Parameters:
      valueClass - enumeration class.
      compact - enumeration value compact name.
      Returns:
      value.
    • byNameOrCompact

      public static ManagedEnum byNameOrCompact(Class<?> valueClass, String nameOrCompact)
      Retrieves an ManagedEnum value based on its class and ManagedEnum.compact() name or regular ManagedEnum#name().
      Parameters:
      valueClass - enumeration class.
      nameOrCompact - enumeration value compact name or regular name.
      Returns:
      value.
    • isManagedEnum

      public static boolean isManagedEnum(Class<?> valueClass)
      Determines if a given valueClass is a supported ManagedEnum.
      Parameters:
      valueClass - potential enumeration class.
      Returns:
      true if supported ManagedEnum.
    • managedClasses

      public static Set<Class<?>> managedClasses()
      Returns a set of managed enum classes.