public final M parse(Element element) {
M model = null;
try {
AnnotationMirror mirror = null;
if (getAnnotationType() != null) {
mirror = ElementUtils.findAnnotationMirror(processingEnv, element.getAnnotationMirrors(), getAnnotationType());
}
if (!context.getTruffleTypes().verify(context, element, mirror)) {
return null;
}
model = parse(element, mirror);
if (model == null) {
return null;
}
redirectMessages(new HashSet<MessageContainer>(), model, model);
model.emitMessages(context, log);
if (model instanceof NodeData) {
return model;
} else {
return filterErrorElements(model);
}
} catch (CompileErrorException e) {
log.message(Kind.WARNING, element, null, null, "The truffle processor could not parse class due to error: %s", e.getMessage());
return null;
}
}