Class EnumFactory


public class EnumFactory extends TypeFactory
The CtEnum sub-factory.
  • Constructor Details

    • EnumFactory

      public EnumFactory(Factory factory)
      Creates a new enum sub-factory.
      Parameters:
      factory - the parent factory
  • Method Details

    • create

      public CtEnum<?> create(CtPackage owner, String simpleName)
      Creates a new enumeration type
      Parameters:
      owner - package
      simpleName - the simple name
    • create

      public CtEnum<?> create(String qualifiedName)
      Creates an enum from its qualified name.
    • get

      public CtEnum<?> get(String qualifiedName)
      Gets an already created enumeration from its qualified name.
      Overrides:
      get in class TypeFactory
      Returns:
      the enumeration or null if does not exist
    • getEnum

      public <T extends Enum<?>> CtEnum<T> getEnum(Class<T> cl)
      Gets a class from its runtime Java class.
      Type Parameters:
      T - type of created class
      Parameters:
      cl - the java class: note that this class should be Class<T> but it then poses problem when T is a generic type itself