java.lang.Object
io.helidon.builder.processor.tools.BuilderTypeTools
io.helidon.pico.tools.TypeTools
- All Implemented Interfaces:
TypeInfoCreatorProvider
Generically handles Pico generated artifact creation via APT.
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<AnnotationAndValue>createAnnotationAndValueListFromAnnotations(Annotation[] annotations) Deprecated.switch to use pure annotation processing instead of reflectionstatic Set<AnnotationAndValue>createAnnotationAndValueSet(io.github.classgraph.AnnotationInfoList annotationInfoList) Creates a set of annotations given the owning element.static Set<AnnotationAndValue>Creates a set of annotations based using annotation processor.static Set<QualifierAndValue>createQualifierAndValueSet(List<? extends AnnotationMirror> annoMirrors) Creates a set of qualifiers given the owning element's annotation type mirror.static Set<QualifierAndValue>Creates a set of qualifiers given the owning element.static StringextractInjectionPointTypeInfo(Element typeElement, AtomicReference<Boolean> isProviderWrapped, AtomicReference<Boolean> isListWrapped, AtomicReference<Boolean> isOptionalWrapped) Determines the meta parts making upInjectionPointInfofor annotation processing.static booleanisAbstract(Element element) Returns true if the element is abstract.static booleanisProviderType(String typeName) Determines whether the type is aProvider(or javax equiv) type.static booleanReturns true if the element is static.static booleanneedToDeclareModuleUsage(String moduleName) Checks whether the module name needs to be declared.static booleanneedToDeclarePackageUsage(String packageName) Checks whether the package name need to be declared.static StringoppositeOf(String typeName) Transposes "jakarta." from and/or to "javax.".static ElementInfo.AccessDetermines the access from anElement(from anno processing).static StringtoFilePath(TypeName typeName) Converts the provided name to a type name path.static StringtoFilePath(TypeName typeName, String fileType) Converts the provided name to a type name path.Methods inherited from class io.helidon.builder.processor.tools.BuilderTypeTools
canAccept, copyrightHeaderFor, createAnnotationAndValueFromMirror, createAnnotationAndValueListFromElement, createTypedElementNameFromElement, createTypeInfo, createTypeNameFromDeclaredType, createTypeNameFromElement, createTypeNameFromMirror, extractValue, extractValues, extractValues, findAnnotationMirror, generatedStickerFor, toElementInfo, toTypeElement
-
Method Details
-
toFilePath
Converts the provided name to a type name path.- Parameters:
typeName- the type name to evaluate- Returns:
- the file path expression where dots are translated to file separators
-
toFilePath
Converts the provided name to a type name path.- Parameters:
typeName- the type name to evaluatefileType- the file type, typically ".java"- Returns:
- the file path expression where dots are translated to file separators
-
createAnnotationAndValueListFromAnnotations
@Deprecated public static List<AnnotationAndValue> createAnnotationAndValueListFromAnnotations(Annotation[] annotations) Deprecated.switch to use pure annotation processing instead of reflectionCreates an instance from reflective access. Note that this approach will only have visibility to theRetentionPolicy.RUNTIMEtype annotations.- Parameters:
annotations- the annotations on the type, method, or parameters- Returns:
- the new instance
-
createQualifierAndValueSet
Creates a set of qualifiers given the owning element.- Parameters:
type- the element type (from anno processing)- Returns:
- the set of qualifiers that the owning element has
-
createQualifierAndValueSet
public static Set<QualifierAndValue> createQualifierAndValueSet(List<? extends AnnotationMirror> annoMirrors) Creates a set of qualifiers given the owning element's annotation type mirror.- Parameters:
annoMirrors- the annotation type mirrors (from anno processing)- Returns:
- the set of qualifiers that the owning element has
-
createAnnotationAndValueSet
Creates a set of annotations based using annotation processor.- Parameters:
type- the enclosing/owing type element- Returns:
- the annotation value set
-
createAnnotationAndValueSet
public static Set<AnnotationAndValue> createAnnotationAndValueSet(io.github.classgraph.AnnotationInfoList annotationInfoList) Creates a set of annotations given the owning element.- Parameters:
annotationInfoList- the list of annotations- Returns:
- the annotation and value set
-
extractInjectionPointTypeInfo
public static String extractInjectionPointTypeInfo(Element typeElement, AtomicReference<Boolean> isProviderWrapped, AtomicReference<Boolean> isListWrapped, AtomicReference<Boolean> isOptionalWrapped) Determines the meta parts making upInjectionPointInfofor annotation processing.- Parameters:
typeElement- the variable / element typeisProviderWrapped- set to indicate that the ip is a provided typeisListWrapped- set to indicate that the ip is a list typeisOptionalWrapped- set to indicate that the ip is an optional type- Returns:
- the return type of the injection point
- Throws:
IllegalStateException- thrown if internal state inconsistencies are found
-
isProviderType
Determines whether the type is aProvider(or javax equiv) type.- Parameters:
typeName- the type name to check- Returns:
- true if
ProviderorInjectionPointProvider
-
oppositeOf
Transposes "jakarta." from and/or to "javax.".- Parameters:
typeName- the type name to transpose- Returns:
- the transposed value, or the same if not able to be transposed
-
isStatic
Returns true if the element is static.- Parameters:
element- the element- Returns:
- true if static
-
isAbstract
Returns true if the element is abstract.- Parameters:
element- the element- Returns:
- true if abstract
-
toAccess
Determines the access from anElement(from anno processing).- Parameters:
element- the element- Returns:
- the access
-
needToDeclarePackageUsage
Checks whether the package name need to be declared.- Parameters:
packageName- the package name- Returns:
- true if the package name needs to be declared
-
needToDeclareModuleUsage
Checks whether the module name needs to be declared.- Parameters:
moduleName- the module name- Returns:
- true if the module name needs to be declared
-