Class AptTypeFactory

java.lang.Object
io.helidon.codegen.apt.AptTypeFactory

public final class AptTypeFactory extends Object
Factory for types.
  • Method Details

    • createTypeName

      public static Optional<TypeName> createTypeName(DeclaredType type)
      Creates a name from a declared type during annotation processing.
      Parameters:
      type - the element type
      Returns:
      the associated type name instance
    • createTypeName

      public static Optional<TypeName> createTypeName(TypeMirror typeMirror)
      Create type from type mirror.
      Parameters:
      typeMirror - annotation processing type mirror
      Returns:
      type name
      Throws:
      IllegalArgumentException - when the mirror cannot be resolved into a name (such as when it represents none or error)
    • createTypeName

      public static Optional<TypeName> createTypeName(TypeElement element, TypeMirror mirror)
      Create type from type mirror. The element is needed to correctly map type arguments to type parameters.
      Parameters:
      element - the type element of the type mirror
      mirror - the type mirror as declared in source code
      Returns:
      type for the provided values
    • createTypeName

      public static Optional<TypeName> createTypeName(Element type)
      Creates a name from an element type during annotation processing.
      Parameters:
      type - the element type
      Returns:
      the associated type name instance