Package de.thomas_oster.lazysql
Class LazySQLProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
de.thomas_oster.lazysql.LazySQLProcessor
- All Implemented Interfaces:
Processor
@SupportedAnnotationTypes({"de.thomas_oster.lazysql.annotations.LazySQLSelect","de.thomas_oster.lazysql.annotations.LazySQLConfig","de.thomas_oster.lazysql.annotations.LazySQLUpdate","de.thomas_oster.lazysql.annotations.LazySQLExec","de.thomas_oster.lazysql.annotations.LazySQLUpsert","de.thomas_oster.lazysql.annotations.LazySQLInsert","de.thomas_oster.lazysql.annotations.LazySQLStoredProcedure","de.thomas_oster.layzsql.annotations.Returns"})
@AutoService(javax.annotation.processing.Processor.class)
public class LazySQLProcessor
extends AbstractProcessor
- Author:
- Thomas Oster (mail@thomas-oster.de)
-
Field Summary
FieldsFields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckIfAllArgumentsAreUsed(String sql, List<Argument> arguments, Element element) Prüft ob alle Parameter in der SQL Query vorkommen und gibt sonst eine Fehlermeldung an dem Element ausstatic voidIterable<? extends Completion>getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText) voidbooleanprocess(Set<? extends TypeElement> set, RoundEnvironment roundEnvironment) replaceArgumentsAndListOrder(String query, List<Argument> parameters, List<Argument> argumentsInQueryOrder) Replaces all :Argument strings in the SQL query with ?, checks if they are present in the excpectedArguments and put them (possible multiple times) into argumentsInQueryOrderMethods inherited from class javax.annotation.processing.AbstractProcessor
getSupportedAnnotationTypes, getSupportedOptions, isInitialized
-
Field Details
-
DEBUG_TO_FILE
public static final boolean DEBUG_TO_FILE- See Also:
-
-
Constructor Details
-
LazySQLProcessor
public LazySQLProcessor()
-
-
Method Details
-
replaceArgumentsAndListOrder
public String replaceArgumentsAndListOrder(String query, List<Argument> parameters, List<Argument> argumentsInQueryOrder) throws Argument.MismatchException Replaces all :Argument strings in the SQL query with ?, checks if they are present in the excpectedArguments and put them (possible multiple times) into argumentsInQueryOrder- Parameters:
query-parameters- List with possible argumentsargumentsInQueryOrder- Result List with Arguemtns in query order- Returns:
- returns the query with all arguments
- Throws:
Argument.MismatchException
-
getCompletions
public Iterable<? extends Completion> getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText) - Specified by:
getCompletionsin interfaceProcessor- Overrides:
getCompletionsin classAbstractProcessor
-
debugLog
-
checkIfAllArgumentsAreUsed
public void checkIfAllArgumentsAreUsed(String sql, List<Argument> arguments, Element element) throws ElementException Prüft ob alle Parameter in der SQL Query vorkommen und gibt sonst eine Fehlermeldung an dem Element aus- Parameters:
sql-arguments-element-- Throws:
ElementException
-
process
- Specified by:
processin interfaceProcessor- Specified by:
processin classAbstractProcessor
-
init
- Specified by:
initin interfaceProcessor- Overrides:
initin classAbstractProcessor
-
getSupportedSourceVersion
- Specified by:
getSupportedSourceVersionin interfaceProcessor- Overrides:
getSupportedSourceVersionin classAbstractProcessor
-