Class GenericUtils
java.lang.Object
io.micronaut.annotation.processing.GenericUtils
Utility methods for dealing with generic type signatures.
- Author:
- Graeme Rocher
-
Constructor Summary
ModifierConstructorDescriptionprotected
GenericUtils
(Elements elementUtils, Types typeUtils, ModelUtils modelUtils) -
Method Summary
Modifier and TypeMethodDescriptionList<? extends TypeMirror>
interfaceGenericTypesFor
(TypeElement element, String interfaceName) Finds the generic types for the given interface for the given class element.protected Map<String,
TypeMirror> Resolve bound types for the given declared type.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.
-
Constructor Details
-
GenericUtils
- Parameters:
elementUtils
- TheElements
typeUtils
- TheTypes
modelUtils
- TheModelUtils
-
-
Method Details
-
interfaceGenericTypesFor
public List<? extends TypeMirror> interfaceGenericTypesFor(TypeElement element, String interfaceName) Finds the generic types for the given interface for the given class element.- Parameters:
element
- The class elementinterfaceName
- The interface- Returns:
- The generic types or an empty list
-
resolveTypeReference
Resolve a type reference to use for the given type mirror taking into account generic type variables.- Parameters:
mirror
- The mirrorboundTypes
- The already bound types for any type variable- Returns:
- A type reference
-
resolveBoundTypes
Resolve bound types for the given declared type.- Parameters:
type
- The declaring type- Returns:
- The type bounds
-