java.lang.Object
io.helidon.codegen.TypeInfoFactoryBase
io.helidon.codegen.apt.AptTypeInfoFactory
Factory to analyze processed types and to provide
TypeInfo
for them.-
Method Summary
Modifier and TypeMethodDescriptioncreate
(AptContext ctx, TypeName typeName) Create type information for a type name, reading all child elements.create
(AptContext ctx, TypeName typeName, Predicate<TypedElementInfo> elementPredicate) Create type information for a type name.create
(AptContext ctx, TypeElement typeElement) Create type information from a type element, reading all child elements.create
(AptContext ctx, TypeElement typeElement, Predicate<TypedElementInfo> elementPredicate) Create type information from a type element.static Optional
<TypedElementInfo> createTypedElementInfoFromElement
(AptContext ctx, Element v, Elements elements) Creates an instance of aTypedElementInfo
given its type and variable element from annotation processing.Methods inherited from class io.helidon.codegen.TypeInfoFactoryBase
annotationFilter, isBuiltInJavaType, mapAnnotation, mapElement, mapType, modifiers
-
Method Details
-
create
Create type information for a type name, reading all child elements.- Parameters:
ctx
- annotation processor processing contexttypeName
- type name to find- Returns:
- type info for the type element
- Throws:
IllegalArgumentException
- when the element cannot be resolved into type info (such as if you ask for a primitive type)
-
create
public static Optional<TypeInfo> create(AptContext ctx, TypeName typeName, Predicate<TypedElementInfo> elementPredicate) throws IllegalArgumentException Create type information for a type name.- Parameters:
ctx
- annotation processor processing environmenttypeName
- type name to findelementPredicate
- predicate for child elements- Returns:
- type info for the type element, or empty if it cannot be resolved
- Throws:
IllegalArgumentException
-
create
Create type information from a type element, reading all child elements.- Parameters:
ctx
- annotation processor processing contexttypeElement
- type element of the type we want to analyze- Returns:
- type info for the type element
- Throws:
IllegalArgumentException
- when the element cannot be resolved into type info (such as if you ask for a primitive type)
-
create
public static Optional<TypeInfo> create(AptContext ctx, TypeElement typeElement, Predicate<TypedElementInfo> elementPredicate) throws IllegalArgumentException Create type information from a type element.- Parameters:
ctx
- annotation processor processing contexttypeElement
- type element of the type we want to analyzeelementPredicate
- predicate for child elements- Returns:
- type info for the type element, or empty if it cannot be resolved
- Throws:
IllegalArgumentException
-
createTypedElementInfoFromElement
public static Optional<TypedElementInfo> createTypedElementInfoFromElement(AptContext ctx, Element v, Elements elements) Creates an instance of aTypedElementInfo
given its type and variable element from annotation processing. If the passed in element is not aElementKind.FIELD
,ElementKind.METHOD
,ElementKind.CONSTRUCTOR
, orElementKind.PARAMETER
then this method may return empty.- Parameters:
ctx
- annotation processing contextv
- the element (from annotation processing)elements
- the elements- Returns:
- the created instance
-