Preserve parameter level annotations in generated source

This commit is contained in:
Travis Burtrum 2017-06-11 20:25:53 -04:00
parent 881de93799
commit 12ba416181
1 changed files with 7 additions and 0 deletions

View File

@ -235,6 +235,7 @@ public class JdbcMapperProcessor extends AbstractProcessor {
final int numParams = params.size();
int count = 0;
for (final VariableElement param : params) {
writeAllParamAnnotations(w, param);
w.write("final ");
w.write(param.asType().toString());
w.write(' ');
@ -593,6 +594,12 @@ public class JdbcMapperProcessor extends AbstractProcessor {
w.write(");\n");
}
private void writeAllParamAnnotations(final Writer w, final VariableElement param) throws IOException {
// todo: should this always be done for everything? allow turn off, exclude some annotations, or what?
for(final AnnotationMirror am : param.getAnnotationMirrors())
w.append(am.toString()).append(' ');
}
private static TypeMirror getSqlParser(final JdbcMapper.Mapper mapper) {
// ridiculous isn't it?
try {