Package pro.projo.generation.utilities
Interface TypeMirrorUtilities
- All Known Implementing Classes:
InterfaceTemplateProcessor,MergeOptions,ProjoProcessor,ProjoTemplateFactoryProcessor,Source.EnumSource,Source.InterfaceSource,TemplateConfiguration,TypeConverter
public interface TypeMirrorUtilities
TypeMirrorUtilities is a collection of useful methods for dealing with TypeMirrors.- Author:
- Mirko Raner
-
Method Summary
Modifier and Type Method Description default Map<TypeMirror,String>getMap(Source map)default <_Type_> Class<_Type_>getType(Supplier<Class<?>> supplier)Resolves a possibly type-mirroredClass.default TypeMirrorgetTypeMirror(Supplier<Class<?>> supplier)Converts aClassinto aTypeMirror.
-
Method Details
-
getTypeMirror
Converts aClassinto aTypeMirror.- Parameters:
supplier- a method that returns theClass(as theClassitself will not work during annotation processing)- Returns:
- the corresponding
TypeMirror
-
getType
Resolves a possibly type-mirroredClass. If the class is indeed type-mirrored, this method will first construct theTypeMirrorand then use the type name to create the correspondingClassobject. If the class is not type-mirrored the method will simply return theClassobject provided by theSupplier.- Type Parameters:
_Type_- the type represented by the class- Parameters:
supplier- a possibly type-mirroredClassSupplier- Returns:
- the
Class(constructed directly, or via an intermediateTypeMirrorif necessary)
-
getMap
- Parameters:
map- theInterfaceannotation instance- Returns:
- a map of
TypeMirrors to class names
-