|
|
|
@ -37,36 +37,27 @@ import com.mysema.query.annotations.QueryTransient; |
|
|
|
import com.mysema.query.apt.DefaultConfiguration; |
|
|
|
import com.mysema.query.apt.DefaultConfiguration; |
|
|
|
import com.mysema.query.apt.Processor; |
|
|
|
import com.mysema.query.apt.Processor; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Annotation processor to create Querydsl query types for QueryDsl annoated |
|
|
|
* Annotation processor to create Querydsl query types for QueryDsl annoated classes |
|
|
|
* classes |
|
|
|
|
|
|
|
* |
|
|
|
* |
|
|
|
* @author Oliver Gierke |
|
|
|
* @author Oliver Gierke |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@SupportedAnnotationTypes({ "com.mysema.query.annotations.*" }) |
|
|
|
@SupportedAnnotationTypes({ "com.mysema.query.annotations.*", "org.springframework.data.document.mongodb.mapping.*" }) |
|
|
|
@SupportedSourceVersion(SourceVersion.RELEASE_6) |
|
|
|
@SupportedSourceVersion(SourceVersion.RELEASE_6) |
|
|
|
public class MongoAnnotationProcessor extends AbstractProcessor { |
|
|
|
public class MongoAnnotationProcessor extends AbstractProcessor { |
|
|
|
|
|
|
|
|
|
|
|
private Class<? extends Annotation> entities, entity, embedded, skip; |
|
|
|
private Class<? extends Annotation> entities, entity, embedded, skip; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean process(Set<? extends TypeElement> annotations, |
|
|
|
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { |
|
|
|
RoundEnvironment roundEnv) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, |
|
|
|
processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Running " + getClass().getSimpleName()); |
|
|
|
"Running " + getClass().getSimpleName()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DefaultConfiguration configuration = |
|
|
|
DefaultConfiguration configuration = new DefaultConfiguration(roundEnv, processingEnv.getOptions(), |
|
|
|
new DefaultConfiguration(roundEnv, processingEnv.getOptions(), |
|
|
|
Collections.<String> emptySet(), QueryEntities.class, Document.class, QuerySupertype.class, |
|
|
|
Collections.<String> emptySet(), QueryEntities.class, |
|
|
|
QueryEmbeddable.class, QueryEmbedded.class, QueryTransient.class); |
|
|
|
Document.class, QuerySupertype.class, |
|
|
|
|
|
|
|
QueryEmbeddable.class, QueryEmbedded.class, |
|
|
|
|
|
|
|
QueryTransient.class); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Processor processor = |
|
|
|
Processor processor = new Processor(processingEnv, roundEnv, configuration); |
|
|
|
new Processor(processingEnv, roundEnv, configuration); |
|
|
|
|
|
|
|
processor.process(); |
|
|
|
processor.process(); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|