Class TypeResolver

java.lang.Object
org.jboss.arquillian.graphene.spi.TypeResolver

public class TypeResolver extends Object
Instantiates given class while it reflects annotation ImplementedBy in order to determine final implementation of given type.
Author:
Lukas Fryc
  • Constructor Details

    • TypeResolver

      public TypeResolver()
  • Method Details

    • resolveType

      public static <T> Class<? extends T> resolveType(String typeName)
      Resolves type based on given className, while it reflects annotation ImplementedBy in order to determine final implementation of given type.
      Parameters:
      typeName - the name of the type
      Returns:
      the implementation class for given type
    • resolveType

      public static <T> Class<? extends T> resolveType(Class<T> type)
      Resolves implementation type based on given type, while it reflects annotation ImplementedBy in order to determine final implementation of given type.
      Parameters:
      type - the type to be resolved
      Returns:
      the implementation class for given type
    • instantiate

      public static <T> T instantiate(String className)
      Instantiates a class by given implementation name
      Parameters:
      className -
      Returns:
    • instantiate

      public static <T> T instantiate(Class<T> type)
      Instantiates class by given type, while it reflects annotation ImplementedBy in order to determine final implementation of given type.
      Parameters:
      type - the type of the instantiated instance, which can be either final implementation type or type annotated by ImplementedBy in order to determine final implementation of given type.
      Returns:
      instance of given type