public void debug(String message, Object... args) { message(Kind.ERROR, null, null, null, message, args); }
public boolean verify(ProcessorContext context, Element element, AnnotationMirror mirror) { if (errors.isEmpty()) { return true; } for (String error : errors) { context.getLog().message(Kind.ERROR, element, mirror, null, error); } return false; }
public boolean verify(ProcessorContext context, Element element, AnnotationMirror mirror) { if (errors.isEmpty()) { return true; } for (String error : errors) { context.getLog().message(Kind.ERROR, element, mirror, null, error); } return false; }
private void verifyExpectedMessages(ProcessorContext context, Log log, List<Message> msgs) { TypeElement expectError = context.getTruffleTypes().getExpectError(); if (expectError != null) { Element element = getMessageElement(); if (element != null) { AnnotationMirror mirror = ElementUtils.findAnnotationMirror(element.getAnnotationMirrors(), expectError.asType()); if (mirror != null) { List<String> values = ElementUtils.getAnnotationValueList(String.class, mirror, "value"); if (values == null) { values = Collections.emptyList(); } if (values.size() != msgs.size()) { log.message(Kind.ERROR, element, mirror, ElementUtils.getAnnotationValue(mirror, "value"), String.format("Error count expected %s but was %s.", values.size(), msgs.size())); } } } } }
private void verifyExpectedMessages(ProcessorContext context, Log log, List<Message> msgs) { TypeElement expectError = context.getTruffleTypes().getExpectError(); if (expectError != null) { Element element = getMessageElement(); if (element != null) { AnnotationMirror mirror = ElementUtils.findAnnotationMirror(element.getAnnotationMirrors(), expectError.asType()); if (mirror != null) { List<String> values = ElementUtils.getAnnotationValueList(String.class, mirror, "value"); if (values == null) { values = Collections.emptyList(); } if (values.size() != msgs.size()) { log.message(Kind.ERROR, element, mirror, ElementUtils.getAnnotationValue(mirror, "value"), String.format("Error count expected %s but was %s.", values.size(), msgs.size())); } } } } }
@Override protected NodeData parse(Element element, AnnotationMirror mirror) { NodeData node = parseRootType((TypeElement) element); if (Log.isDebug() && node != null) { String dump = node.dump(); log.message(Kind.ERROR, null, null, null, dump); } return node; }
@Override protected NodeData parse(Element element, AnnotationMirror mirror) { NodeData node = parseRootType((TypeElement) element); if (Log.isDebug() && node != null) { String dump = node.dump(); log.message(Kind.ERROR, null, null, null, dump); } return node; }
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); 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; } }
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; } }