use of com.abubusoft.kripton.processor.bind.model.many2many.M2MModel in project kripton by xcesco.
the class BindMany2ManySubProcessor method process.
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
try {
model = new M2MModel();
for (Element daoItem : roundEnv.getElementsAnnotatedWith(BindDaoMany2Many.class)) {
if (daoItem.getKind() != ElementKind.INTERFACE) {
String msg = String.format("%s %s, only interface can be annotated with @%s annotation", daoItem.getKind(), daoItem, BindDaoMany2Many.class.getSimpleName());
throw (new InvalidKindForAnnotationException(msg));
}
M2MEntity entity = M2MEntity.extractEntityManagedByDAO((TypeElement) daoItem);
model.entityAdd(entity);
}
result = BindM2MBuilder.generate(filer, model);
} catch (Exception e) {
String msg = e.getMessage();
error(null, msg);
if (DEBUG_MODE) {
logger.log(Level.SEVERE, msg);
e.printStackTrace();
}
}
return true;
}
Aggregations