public interface TypeMirrorUtilities
TypeMirrorUtilities is a collection of useful methods for dealing with TypeMirrors.| Modifier and Type | Method and Description |
|---|---|
Elements |
elements()
Provides access to the
Elements. |
default Map<TypeMirror,String> |
getMap(Source map)
|
default <_Type_> Class<_Type_> |
getType(Supplier<Class<?>> supplier)
Resolves a possibly type-mirrored
Class. |
default TypeElement |
getTypeElement(Supplier<Class<?>> supplier)
Converts a
Class into a TypeElement. |
default TypeMirror |
getTypeMirror(Supplier<Class<?>> supplier)
Converts a
Class into a TypeMirror. |
Elements elements()
Elements.
This method must be implemented by the client type.Elementsdefault TypeMirror getTypeMirror(Supplier<Class<?>> supplier)
Class into a TypeMirror.supplier - a method that returns the Class (as the Class itself will not
work during annotation processing)TypeMirrordefault TypeElement getTypeElement(Supplier<Class<?>> supplier)
Class into a TypeElement.supplier - a method that returns the Class (as the Class itself will not
work during annotation processing)TypeElementdefault <_Type_> Class<_Type_> getType(Supplier<Class<?>> supplier)
Class. If the class is indeed type-mirrored, this
method will first construct the TypeMirror and then use the type name to create the
corresponding Class object. If the class is not type-mirrored the method will simply
return the Class object provided by the Supplier._Type_ - the type represented by the classsupplier - a possibly type-mirrored Class SupplierClass (constructed directly, or via an intermediate TypeMirror if necessary)default Map<TypeMirror,String> getMap(Source map)
map - the Interface annotation instanceTypeMirrors to class namesCopyright © 2022. All rights reserved.