| Modifier | Constructor and Description |
|---|---|
protected |
GenericUtils(Elements elementUtils,
Types typeUtils,
ModelUtils modelUtils) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,TypeMirror> |
alignNewGenericsInfo(List<? extends TypeParameterElement> typeParameters,
List<? extends TypeMirror> typeArguments,
Map<String,TypeMirror> genericsInfo)
Takes the bound generic information and re-aligns for the new type.
|
Map<String,Map<String,TypeMirror>> |
alignNewGenericsInfo(TypeElement typeElement,
List<? extends TypeMirror> typeArguments,
Map<String,TypeMirror> genericsInfo)
Takes a type element and the bound generic information and re-aligns for the new type.
|
Map<String,Map<String,TypeMirror>> |
buildGenericTypeArgumentElementInfo(Element element)
Builds type argument information for the given type.
|
Map<String,Map<String,TypeMirror>> |
buildGenericTypeArgumentElementInfo(Element element,
DeclaredType declaredType)
Builds type argument information for the given type.
|
Map<String,Map<String,TypeMirror>> |
buildGenericTypeArgumentElementInfo(Element element,
DeclaredType declaredType,
Map<String,TypeMirror> boundTypes)
Builds type argument information for the given type.
|
protected Optional<TypeMirror> |
getFirstTypeArgument(TypeMirror type)
Return the first type argument for the given type mirror.
|
List<? extends TypeMirror> |
interfaceGenericTypesFor(TypeElement element,
String interfaceName)
Finds the generic types for the given interface for the given class element.
|
protected Map<String,TypeMirror> |
resolveBoundTypes(DeclaredType type)
Resolve bound types for the given declared type.
|
protected TypeMirror |
resolveTypeReference(TypeMirror mirror) |
protected TypeMirror |
resolveTypeReference(TypeMirror mirror,
Map<String,TypeMirror> boundTypes)
Resolve a type reference to use for the given type mirror taking into account generic type variables.
|
protected GenericUtils(Elements elementUtils, Types typeUtils, ModelUtils modelUtils)
elementUtils - The ElementstypeUtils - The TypesmodelUtils - The ModelUtilspublic Map<String,Map<String,TypeMirror>> buildGenericTypeArgumentElementInfo(@NonNull Element element)
element - The elementpublic Map<String,Map<String,TypeMirror>> buildGenericTypeArgumentElementInfo(@NonNull Element element, @Nullable DeclaredType declaredType)
element - The elementdeclaredType - The declared typepublic Map<String,Map<String,TypeMirror>> buildGenericTypeArgumentElementInfo(@NonNull Element element, @Nullable DeclaredType declaredType, Map<String,TypeMirror> boundTypes)
element - The elementdeclaredType - The declared typeboundTypes - The type variablespublic List<? extends TypeMirror> interfaceGenericTypesFor(TypeElement element, String interfaceName)
element - The class elementinterfaceName - The interfaceprotected Optional<TypeMirror> getFirstTypeArgument(TypeMirror type)
String.type - The typeprotected TypeMirror resolveTypeReference(TypeMirror mirror)
mirror - The TypeMirrorprotected TypeMirror resolveTypeReference(TypeMirror mirror, Map<String,TypeMirror> boundTypes)
mirror - The mirrorboundTypes - The already bound types for any type variableprotected Map<String,TypeMirror> resolveBoundTypes(DeclaredType type)
type - The declaring typepublic Map<String,Map<String,TypeMirror>> alignNewGenericsInfo(TypeElement typeElement, List<? extends TypeMirror> typeArguments, Map<String,TypeMirror> genericsInfo)
typeElement - The type elementtypeArguments - The type argumentsgenericsInfo - The generic infopublic Map<String,TypeMirror> alignNewGenericsInfo(List<? extends TypeParameterElement> typeParameters, List<? extends TypeMirror> typeArguments, Map<String,TypeMirror> genericsInfo)
typeParameters - The type parameterstypeArguments - The type argumentsgenericsInfo - The generic info