Package javax.annotation.processing

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


                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

                StringBuilder cycleInfo = new StringBuilder();
                for (String cycle : cycles) {
                    cycleInfo.append(cycle).append(" -> ");
                }
                cycleInfo.append(cycles.get(0));
                messager.printMessage(ERROR,
                        "Cyclic dependencies detected for action [" + payload + "]: " + cycleInfo);
                messager.printMessage(ERROR, "Please review [" + graphVizFile + "] for more details.");
            }
            if (!cyclesFound) {
                messager.printMessage(NOTE, "No cyclic dependencies found for action [" + payload + "]");
View Full Code Here

                    cycleInfo.append(cycle).append(" -> ");
                }
                cycleInfo.append(cycles.get(0));
                messager.printMessage(ERROR,
                        "Cyclic dependencies detected for action [" + payload + "]: " + cycleInfo);
                messager.printMessage(ERROR, "Please review [" + graphVizFile + "] for more details.");
            }
            if (!cyclesFound) {
                messager.printMessage(NOTE, "No cyclic dependencies found for action [" + payload + "]");
            }
        }
View Full Code Here

                messager.printMessage(ERROR,
                        "Cyclic dependencies detected for action [" + payload + "]: " + cycleInfo);
                messager.printMessage(ERROR, "Please review [" + graphVizFile + "] for more details.");
            }
            if (!cyclesFound) {
                messager.printMessage(NOTE, "No cyclic dependencies found for action [" + payload + "]");
            }
        }
    }
}
View Full Code Here

            {
                continue;
            }

            System.out.println( "Testing message for: " + kind );
            messager.printMessage( kind, kind + " Test message." );
        }

        return true;
    }
View Full Code Here

    for (Element element : elements) {
      Path annotation = element.getAnnotation(Path.class);

      // make sure we only work on classes or interfaces @Path annotated
      if (annotation != null && (element.getKind() == ElementKind.CLASS || element.getKind() == ElementKind.INTERFACE)) {
        messager.printMessage(Kind.NOTE, "Generating documentation class for : " + element);
        // extract some names
        Name name = element.getSimpleName();
        PackageElement elementPackage = elementUtils.getPackageOf(element);
        // the javadoc
        String doc = elementUtils.getDocComment(element);
View Full Code Here

        PackageElement elementPackage = elementUtils.getPackageOf(element);
        // the javadoc
        String doc = elementUtils.getDocComment(element);
        // build a new class name
        String className = elementPackage.getQualifiedName() + "." + name + "_Doc";
        messager.printMessage(Kind.NOTE, "Class: " + className);
        try {
          // now write the new class which will be compiled in the
          // same run
          JavaFileObject sourceFile = processingEnv.getFiler().createSourceFile(className, element);
          Writer writer = sourceFile.openWriter();
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.