Class EnumFactory

    • Constructor Detail

      • EnumFactory

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

      • create

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

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

        public CtEnum<?> get​(java.lang.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 java.lang.Enum<?>> CtEnum<T> getEnum​(java.lang.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