Class EnumFactory

    • Constructor Detail

      • EnumFactory

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

      • create

        public CtEnum<?> create​(CtPackage owner,
                                java.lang.String simpleName)
        Creates a new enumeration type
        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.
        get in class TypeFactory
        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
        cl - the java class: note that this class should be Class<T> but it then poses problem when T is a generic type itself