Class TypeFactory

java.lang.Object
io.helidon.metadata.reflection.TypeFactory

public final class TypeFactory extends Object
Reflection based support to get classes and types.
  • Method Details

    • toClass

      public static Class<?> toClass(TypeName typeName)
      Create a class from a type name. Primitive and array types are resolved directly. Other types use Class.forName(String).
      Parameters:
      typeName - type to convert to class
      Returns:
      a class representing the type (ignoring generics)
      Throws:
      IllegalArgumentException - in case the class cannot be created
    • toType

      public static Type toType(TypeName typeName)
      Convert a type name to a Type.
      Parameters:
      typeName - type name
      Returns:
      a Type representing the type name, may be a class, wildcard, or parameterized type
      Throws:
      IllegalArgumentException - if the type cannot be resolved or is an array with a parameterized component