Examples of Filer


Examples of javax.annotation.processing.Filer

            final MustacheFactory factory = new DefaultMustacheFactory();
            final Mustache mustache = factory.compile("templates/template.mustache");

            try {
                final Filer filer = processingEnv.getFiler();
                final JavaFileObject file = filer.createSourceFile(type.getName().getQualified());

                try (Writer writer = file.openWriter()) {
                    mustache.execute(writer, type).flush();
                }
            } catch (IOException e) {
View Full Code Here

Examples of javax.annotation.processing.Filer

            final MustacheFactory factory = new DefaultMustacheFactory();
            final Mustache mustache = factory.compile("templates/template.mustache");

            try {
                final Filer filer = processingEnv.getFiler();
                final JavaFileObject file = filer.createSourceFile(type.getName().getQualified());

                try (Writer writer = file.openWriter()) {
                    mustache.execute(writer, type).flush();
                }
            } catch (IOException e) {
View Full Code Here

Examples of javax.annotation.processing.Filer

                    list.add(e.toString());
                }
            }

            if (!classes.isEmpty()) {
                final Filer filer = processingEnv.getFiler();
                FileObject fo = filer.createResource(StandardLocation.CLASS_OUTPUT, "", "META-INF/restmodelextensions");
                bw = new BufferedWriter(fo.openWriter());
                // parent model:model extension
                for (Map.Entry<String, List<String>> entry : classes.entrySet()) {
                    final String key = entry.getKey();
                    for (String ext : entry.getValue()) {
View Full Code Here

Examples of javax.annotation.processing.Filer

  }
 
  public boolean process(Set<? extends TypeElement> annotations,
      RoundEnvironment roundEnv) {
    ProcessingEnvironment env = super.processingEnv;
    Filer filer = env.getFiler();
    Set<TypeElement> annotatedDecls = (Set<TypeElement>) roundEnv.getElementsAnnotatedWith(AsyncService.class);
    for(Iterator<TypeElement> i = annotatedDecls.iterator(); i.hasNext(); ) {
      writeAsyncType(filer,i.next());
    }
    return true;
View Full Code Here

Examples of javax.annotation.processing.Filer

        return name+"_handler.xml";
    }

    private void generateHandlerChainFile(Element hChains, String name) {
       
        Filer filer = options.filer;

        try {
            IndentingWriter p;
            FileObject jfo;
            if (filer != null) {
                jfo = filer.createResource(StandardLocation.SOURCE_OUTPUT,
                        Names.getPackageName(name), getHandlerConfigFileName(name));
                options.addGeneratedFile(new File(jfo.toUri()));
                p = new IndentingWriter(new OutputStreamWriter(jfo.openOutputStream()));
            } else { // leave for backw. compatibility now
                String hcName = getHandlerConfigFileName(name);
View Full Code Here

Examples of org.apache.jmeter.reporters.Filer

    {
      // error!
    }
    else
    {
       Filer save = (Filer)saveObject;

      // validate filename
      String filename = save.getFile();
      if (filename == null)
      {
        System.err.println("Error. Missing filename in File Reporter.");
        filename = "";
      }

      out.write("<Filer type=\"");
      out.write(JMeterHandler.convertToXML(save.getClass().getName()));
      out.write("\" name=\"");
      out.write(JMeterHandler.convertToXML(save.getName()));
      out.write("\" verbose=\"");
      out.write(""+save.getVerbose());
      out.write("\" append=\"");
      out.write(""+save.getAppend());
      out.write("\" autoFlush=\"");
      out.write("" + save.getAutoFlush());
      out.write("\" viewSubmitData=\"");
      out.write("" + save.getViewSubmitData());
      out.write("\" file=\"");
      out.write(JMeterHandler.convertToXML(filename));
      out.write("\"/>");
    }
  }
View Full Code Here

Examples of org.apache.jmeter.reporters.Filer

  {
  }

  public void save(Saveable saveObject, Writer out) throws java.io.IOException
  {
    Filer save = (Filer)saveObject;
    out.write("<Filer type=\"");
    out.write(JMeterHandler.convertToXML(save.getClass().getName()));
    out.write("\" name=\"");
    out.write(JMeterHandler.convertToXML(save.getName()));
    out.write("\" verbose=\"");
    out.write(""+save.getVerbose());
    out.write("\" append=\"");
    out.write(""+save.getAppend());
    out.write("\" file=\"");
    out.write(JMeterHandler.convertToXML(save.getFile()));
    out.write("\"/>");
  }
View Full Code Here

Examples of org.apache.xindice.core.filer.Filer

        TestSuite suite = new TestSuite("Xindice unit tests");

        // If the Berkeley filer was built in then test it too.
        try {
            Class filerClass = Class.forName("org.apache.xindice.core.filer.BerkeleyBTreeFiler");
            Filer filer = (Filer) filerClass.newInstance();
            suite.addTest(new FilerTestBase("BerkeleyFilerTestCase", filer));
        } catch (Exception e) {
            // If the class wasn't built just ignore it.
        }
View Full Code Here

Examples of org.apache.xindice.core.filer.Filer

        TestSuite suite = new TestSuite("Xindice unit tests");

        // If the Berkeley filer was built in then test it too.
        try {
            Class filerClass = Class.forName("org.apache.xindice.core.filer.BerkeleyBTreeFiler");
            Filer filer = (Filer) filerClass.newInstance();
            suite.addTest(new FilerTestBase("BerkeleyFilerTestCase", filer){});
        } catch (Exception e) {
            // If the class wasn't built just ignore it.
        }
View Full Code Here

Examples of org.apache.xindice.core.filer.Filer

            log.error("Could not close filer for collection " + canonicalName, e);
            return false;
        }

        // prepare
        Filer itsFiler = col.getFiler();
        FilerCopy oldFiler;
        FilerCopy newFiler;
        if (itsFiler == null) {
            if (log.isInfoEnabled()) {
                log.info("Collection " + col.getCanonicalName() + " has no filer. Skipping...");
            }

            return true;
        } if (itsFiler instanceof BTreeFiler) {
            oldFiler = new BTreeCopy();
            newFiler = new BTreeCopy();
        } else if (itsFiler instanceof HashFiler) {
            oldFiler = new HashCopy();
            newFiler = new HashCopy();
        } else {
            if (log.isInfoEnabled()) {
                log.info("Collection " + col.getCanonicalName() + " has unrecognized filer '" + itsFiler.getClass().getName() + "'. Skipping...");
            }

            return true;
        }
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.