java.lang.Object
io.helidon.codegen.TypeInfoFactoryBase
- Direct Known Subclasses:
AptTypeInfoFactory
,ScanTypeInfoFactory
Common code for type info factories.
-
Constructor Summary
ModifierConstructorDescriptionprotected
There are no side effects of this constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static boolean
annotationFilter
(Annotation annotation) A filter for annotations to exclude ones we are not interested in (SuppressWarnings
,Override
,Target
,Retention
,Repeatable
.protected static boolean
isBuiltInJavaType
(TypeName type) Check if the provided type is either a primitive type, or is from thejava
package namespace.protected static List
<Annotation> mapAnnotation
(CodegenContext ctx, Annotation annotation, ElementKind kind) Map an annotation using context type mappers.protected static Optional
<TypedElementInfo> mapElement
(CodegenContext ctx, TypedElementInfo element) Map an element using context type mappers.mapType
(CodegenContext ctx, TypeInfo type) Map a type using context type mappers.modifiers
(CodegenContext ctx, Set<String> stringModifiers) Map a string representation of a modifier to its Helidon counterpart.
-
Constructor Details
-
TypeInfoFactoryBase
protected TypeInfoFactoryBase()There are no side effects of this constructor. All provided methods are static.
-
-
Method Details
-
mapType
Map a type using context type mappers.- Parameters:
ctx
- code generation contexttype
- 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 contextelement
- 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 contextannotation
- annotation to mapkind
- element kind of the annotated element- Returns:
- result of mapping
-
annotationFilter
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
Map a string representation of a modifier to its Helidon counterpart.- Parameters:
ctx
- code generation contextstringModifiers
- set of modifiers- Returns:
- set of Helidon modifiers (without visibility modifiers)
-
isBuiltInJavaType
Check if the provided type is either a primitive type, or is from thejava
package namespace.- Parameters:
type
- type to check- Returns:
true
if the type is a primitive type, or its package starts withjava.
-