Package javax.annotation.processing

Examples of javax.annotation.processing.Messager.printMessage()


   */
  @Requires("r != null")
  protected void printDiagnostic(DiagnosticManager.Report r) {
    Messager messager = processingEnv.getMessager();
    if (r.getElement() == null) {
      messager.printMessage(r.getKind(), r.getMessage(null));
    } else {
      messager.printMessage(r.getKind(), r.getMessage(null), r.getElement(),
                            r.getAnnotationMirror(), r.getAnnotationValue());
    }
  }
View Full Code Here


  protected void printDiagnostic(DiagnosticManager.Report r) {
    Messager messager = processingEnv.getMessager();
    if (r.getElement() == null) {
      messager.printMessage(r.getKind(), r.getMessage(null));
    } else {
      messager.printMessage(r.getKind(), r.getMessage(null), r.getElement(),
                            r.getAnnotationMirror(), r.getAnnotationValue());
    }
  }

  /**
 
View Full Code Here

            final String packageName = packageElement.getQualifiedName().toString();
            final String storeDelegate = storeElement.getSimpleName().toString();
            final boolean changeSupport = typeUtils.isAssignable(storeElement.asType(),
                    elementUtils.getTypeElement(ChangeSupport.class.getName()).asType());
            final String storeClassName = GenerationUtil.storeImplementation(storeDelegate);
            messager.printMessage(NOTE,
                    String.format("Discovered annotated store [%s]", storeElement.getQualifiedName()));

            List<ExecutableElement> processMethods = new ArrayList<>();
            if (findValidProcessMethods(messager, typeUtils, storeElement, processMethods)) {
                Collection<ProcessInfo> processInfos = createProcessInfos(messager, typeUtils, elementUtils,
View Full Code Here

                metadata.add(new StoreDelegateMetadata(packageName, storeClassName, storeDelegate, changeSupport,
                        processInfos));
            } else {
                // no valid process methods!
                messager.printMessage(ERROR,
                        String.format("%s does not contain suitable methods annotated with %s.",
                                storeElement.getQualifiedName(), Process.class.getName()));
                break;
            }
        }
View Full Code Here

        final Messager messager = processingEnv.getMessager();

        // store delegates
        for (StoreDelegateMetadata md : metadata) {
            try {
                messager.printMessage(NOTE, String.format("Generating code for [%s]", md.storeClassName));
                StoreGenerator generator = new StoreGenerator();
                final StringBuffer code = generator.generate(md);
                writeCode(md.packageName, md.storeClassName, code);

                messager.printMessage(NOTE,
View Full Code Here

                messager.printMessage(NOTE, String.format("Generating code for [%s]", md.storeClassName));
                StoreGenerator generator = new StoreGenerator();
                final StringBuffer code = generator.generate(md);
                writeCode(md.packageName, md.storeClassName, code);

                messager.printMessage(NOTE,
                        String.format("Successfully generated store implementation [%s]", md.storeClassName));
            } catch (GenerationException ge) {
                final String msg = ge.getMessage();
                messager.printMessage(Diagnostic.Kind.ERROR, msg/* , storeElement*/);
            }
View Full Code Here

                messager.printMessage(NOTE,
                        String.format("Successfully generated store implementation [%s]", md.storeClassName));
            } catch (GenerationException ge) {
                final String msg = ge.getMessage();
                messager.printMessage(Diagnostic.Kind.ERROR, msg/* , storeElement*/);
            }
        }

        // GraphVIZ
        String graphVizFile = writeGraphViz();
View Full Code Here

    private String writeGraphViz() throws GenerationException, IOException {
        final Messager messager = processingEnv.getMessager();
        GraphVizGenerator generator = new GraphVizGenerator();
        StringBuffer code = generator.generate(graphVizInfos.values());
        messager.printMessage(NOTE,
                "Generating GraphViz file to visualize store dependencies [" + GRAPH_VIZ_OUTPUT + "]");
        FileObject fo = processingEnv.getFiler()
                .createResource(StandardLocation.SOURCE_OUTPUT, "", GRAPH_VIZ_OUTPUT);
        Writer w = fo.openWriter();
        BufferedWriter bw = new BufferedWriter(w);
View Full Code Here

        Writer w = fo.openWriter();
        BufferedWriter bw = new BufferedWriter(w);
        bw.append(code);
        bw.close();
        w.close();
        messager.printMessage(NOTE, "Successfully generated GraphViz file [" + GRAPH_VIZ_OUTPUT + "]");
        return fo.getName();
    }

    private void validateDAG(final String graphVizFile) throws GenerationException {
        boolean cyclesFound = false;
View Full Code Here

        boolean cyclesFound = false;
        final Messager messager = processingEnv.getMessager();
        for (Map.Entry<String, Multimap<String, String>> entry : dagValidation.entrySet()) {
            String payload = entry.getKey();
            Multimap<String, String> dependencies = entry.getValue();
            messager.printMessage(NOTE, "Check cyclic dependencies for action [" + payload + "]");
            DirectedGraph<String, DefaultEdge> dg = new DefaultDirectedGraph<>(DefaultEdge.class);

            // vertices
            for (String store : dependencies.keySet()) {
                dg.addVertex(store);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.