Class TypeInfoFactoryBase

java.lang.Object
io.helidon.codegen.TypeInfoFactoryBase
Direct Known Subclasses:
AptTypeInfoFactory, ScanTypeInfoFactory

public abstract class TypeInfoFactoryBase extends Object
Common code for type info factories.
  • Constructor Details

    • TypeInfoFactoryBase

      protected TypeInfoFactoryBase()
      There are no side effects of this constructor. All provided methods are static.
  • Method Details

    • mapType

      protected static Optional<TypeInfo> mapType(CodegenContext ctx, TypeInfo type)
      Map a type using context type mappers.
      Parameters:
      ctx - code generation context
      type - type to map
      Returns:
      result of mapping
    • mapElement

      protected static Optional<TypedElementInfo> mapElement(CodegenContext ctx, TypedElementInfo element)
      Map an element using context type mappers.
      Parameters:
      ctx - code generation context
      element - element to map
      Returns:
      result of mapping
    • mapAnnotation

      protected static List<Annotation> mapAnnotation(CodegenContext ctx, Annotation annotation, ElementKind kind)
      Map an annotation using context type mappers.
      Parameters:
      ctx - code generation context
      annotation - annotation to map
      kind - element kind of the annotated element
      Returns:
      result of mapping
    • annotationFilter

      protected static boolean annotationFilter(Annotation annotation)
      A filter for annotations to exclude ones we are not interested in (SuppressWarnings, Override, Target, Retention, Repeatable.
      Parameters:
      annotation - annotation to check
      Returns:
      whether the annotation should be included
    • modifiers

      protected static Set<Modifier> modifiers(CodegenContext ctx, Set<String> stringModifiers)
      Map a string representation of a modifier to its Helidon counterpart.
      Parameters:
      ctx - code generation context
      stringModifiers - set of modifiers
      Returns:
      set of Helidon modifiers (without visibility modifiers)
    • isBuiltInJavaType

      protected static boolean isBuiltInJavaType(TypeName type)
      Check if the provided type is either a primitive type, or is from the java package namespace.
      Parameters:
      type - type to check
      Returns:
      true if the type is a primitive type, or its package starts with java.