Class InterfaceFactory


public class InterfaceFactory extends TypeFactory
The CtInterface sub-factory.
  • Constructor Details

    • InterfaceFactory

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

    • create

      public <T> CtInterface<T> create(CtPackage owner, String simpleName)
      Creates an interface.
    • create

      public <T> CtInterface<T> create(CtType<T> owner, String simpleName)
      Creates an inner interface
    • create

      public <T> CtInterface<T> create(String qualifiedName)
      Creates an interface from its qualified name.
      Type Parameters:
      T - type of created interface
      Parameters:
      qualifiedName - full name of interface to create. Name can contain $ for inner types
    • get

      public <T> CtInterface<T> get(String qualifiedName)
      Gets a created interface
      Overrides:
      get in class TypeFactory
      Returns:
      the interface or null if does not exist
    • get

      public <T> CtInterface<T> get(Class<?> cl)
      Gets a interface from its runtime Java class.
      Overrides:
      get in class TypeFactory
      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