public class DtoCollector extends Object
StoredProcedure
.
DtoClass
object is createdModifier and Type | Field and Description |
---|---|
private List<DtoClass> |
dtoClasses |
private Set<? extends Element> |
elements |
Constructor and Description |
---|
DtoCollector(Set<? extends Element> elements) |
Modifier and Type | Method and Description |
---|---|
DtoCollector |
collect()
Collects all DTO classes and searches for all methods which are annotated with
StoredProcedure . |
private Consumer<Element> |
collectDtoMethod(DtoClass dtoClass)
Checks if the method is annotated with
StoredProcedure
and then the method is added to the DtoClass. |
private List<AnnotationMirror> |
getAnnotations(ExecutableElement executableElement)
Gets all non spBee related annotations.
|
List<DtoClass> |
getDtoClasses()
The DTO classes.
|
private Variable |
getVariable(VariableElement variableElement)
Converts a VariableElement object to a Variable object.
|
private Predicate<Element> |
hasDataSourceConstructor()
Checks if the element is an constructor and has a DataSource as parameter.
|
private Predicate<Element> |
isStoredProcedureMethod()
Checks if the element is a method and it's annotated with
StoredProcedure . |
public List<DtoClass> getDtoClasses()
public DtoCollector collect() throws com.sun.codemodel.JClassAlreadyExistsException, IOException
StoredProcedure
.com.sun.codemodel.JClassAlreadyExistsException
IOException
private Predicate<Element> hasDataSourceConstructor()
private Predicate<Element> isStoredProcedureMethod()
StoredProcedure
.private Consumer<Element> collectDtoMethod(DtoClass dtoClass)
StoredProcedure
and then the method is added to the DtoClass.dtoClass
- the DTO class to which the method belongsprivate List<AnnotationMirror> getAnnotations(ExecutableElement executableElement)
executableElement
- the elementprivate Variable getVariable(VariableElement variableElement)
variableElement
- the variable elementCopyright © 2015. All rights reserved.