public class EntityClassCollector extends Object
Entity
.
MapperClass
object is createdModifier and Type | Field and Description |
---|---|
private Set<? extends Element> |
elements |
private List<MapperClass> |
mapperClasses |
private ProcessingEnvironment |
processingEnv |
Constructor and Description |
---|
EntityClassCollector(ProcessingEnvironment processingEnv,
Set<? extends Element> elements) |
Modifier and Type | Method and Description |
---|---|
EntityClassCollector |
collect()
Collects all MappingConstructors of all Entity classes which are annotated with
Entity . |
private Consumer<Element> |
collectMappingConstructor(String qualifiedClassName)
Collects all mapping constructors.
|
List<MapperClass> |
getMapperClasses()
Returns the MapperClass classes.
|
private boolean |
hasMappingConstructor(Element entityClassElement)
Checks if an constructor annotated with
MappingConstructor exists. |
private Predicate<Element> |
isApplicableConstructor(boolean annotatedMappingConstructorExists)
Checks if the element is a constructor which is is public.
|
private boolean |
isMappingConstructor(Element element)
Checks if the elements is annotated with
MappingConstructor . |
private final ProcessingEnvironment processingEnv
private final List<MapperClass> mapperClasses
public EntityClassCollector(ProcessingEnvironment processingEnv, Set<? extends Element> elements)
public List<MapperClass> getMapperClasses()
public EntityClassCollector collect()
Entity
.private Predicate<Element> isApplicableConstructor(boolean annotatedMappingConstructorExists)
MappingConstructor
exists then all other
constructors without such annotation will be ignored.
If no other constructor is annotated with MappingConstructor
then the
constructor without the MappingConstructor
is considered.annotatedMappingConstructorExists
- if an constructor with the MappingConstructor
annotation existsprivate Consumer<Element> collectMappingConstructor(String qualifiedClassName)
qualifiedClassName
- the qualified class nameprivate boolean hasMappingConstructor(Element entityClassElement)
MappingConstructor
exists.entityClassElement
- the elementMappingConstructor
existsprivate boolean isMappingConstructor(Element element)
MappingConstructor
.element
- the elementMappingConstructor
Copyright © 2015. All rights reserved.