Package javax.tools

Examples of javax.tools.FileObject.openOutputStream()


                CeyloncFileManager dfm = (CeyloncFileManager) fileManager;
                String jarFileName = JarUtils.toPlatformIndependentPath(dfm.getLocation(CeylonLocation.RESOURCE_PATH), fo.getName());
                if (!written.contains(jarFileName)) {
                    dfm.setModule(modelLoader.findModuleForFile(new File(jarFileName)));
                    FileObject outFile = dfm.getFileForOutput(StandardLocation.CLASS_OUTPUT, "", jarFileName, null);
                    OutputStream out = outFile.openOutputStream();
                    try {
                        InputStream in = new FileInputStream(new File(fo.getName()));
                        try {
                            JarUtils.copy(in, out);
                        } finally {
View Full Code Here


    if (!metadata.getItems().isEmpty()) {
      try {
        FileObject resource = this.processingEnv.getFiler().createResource(
            StandardLocation.CLASS_OUTPUT, "",
            "META-INF/spring-configuration-metadata.json");
        OutputStream outputStream = resource.openOutputStream();
        try {
          new JsonMarshaller().write(metadata, outputStream);
        }
        finally {
          outputStream.close();
View Full Code Here

          if (createBaseAndSubclass) {
            code = code.replaceFirst("(Ext.define\\([\"'].+?)([\"'],)", "$1Base$2");
            FileObject fo = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT,
                packageName, fileName + "Base.js");
            OutputStream os = fo.openOutputStream();
            os.write(code.getBytes(ExtDirectSpringUtil.UTF8_CHARSET));
            os.close();

            try {
              fo = processingEnv.getFiler().getResource(StandardLocation.SOURCE_OUTPUT, packageName,
View Full Code Here

              is.close();
            } catch (FileNotFoundException e) {
              String subClassCode = generateSubclassCode(modelClass, outputConfig);
              fo = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT, packageName,
                  fileName + ".js");
              os = fo.openOutputStream();
              os.write(subClassCode.getBytes(ExtDirectSpringUtil.UTF8_CHARSET));
              os.close();
            }

          } else {
View Full Code Here

            }

          } else {
            FileObject fo = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT,
                packageName, fileName + ".js");
            OutputStream os = fo.openOutputStream();
            os.write(code.getBytes(ExtDirectSpringUtil.UTF8_CHARSET));
            os.close();
          }

        } catch (ClassNotFoundException e) {
View Full Code Here

          if (createBaseAndSubclass) {
            code = code.replaceFirst("(Ext.define\\(\"[^\"]+?)(\",)", "$1Base$2");
            FileObject fo = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT,
                packageName, fileName + "Base.js");
            OutputStream os = fo.openOutputStream();
            os.write(code.getBytes(ExtDirectSpringUtil.UTF8_CHARSET));
            os.close();

            try {
              fo = processingEnv.getFiler().getResource(StandardLocation.SOURCE_OUTPUT, packageName,
View Full Code Here

              is.close();
            } catch (FileNotFoundException e) {
              String subClassCode = generateSubclassCode(modelClass, outputConfig.isDebug());
              fo = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT, packageName,
                  fileName + ".js");
              os = fo.openOutputStream();
              os.write(subClassCode.getBytes(ExtDirectSpringUtil.UTF8_CHARSET));
              os.close();
            }

          } else {
View Full Code Here

            }

          } else {
            FileObject fo = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT,
                packageName, fileName + ".js");
            OutputStream os = fo.openOutputStream();
            os.write(code.getBytes(ExtDirectSpringUtil.UTF8_CHARSET));
            os.close();
          }

        } catch (ClassNotFoundException e) {
View Full Code Here

      StringBuffer body = generateBody( entity, context );

      FileObject fo = context.getProcessingEnvironment().getFiler().createSourceFile(
          metaModelPackage + "." + entity.getSimpleName() + "_"
      );
      OutputStream os = fo.openOutputStream();
      PrintWriter pw = new PrintWriter( os );

      pw.println( "package " + metaModelPackage + ";" );
      pw.println();
      pw.println( entity.generateImports() );
View Full Code Here

            fileName = typeElement.getSimpleName().toString();
          }

          FileObject fo = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT,
              packageName, fileName + ".js");
          OutputStream os = fo.openOutputStream();
          os.write(code.getBytes(ExtDirectSpringUtil.UTF8_CHARSET));
          os.close();

        } catch (ClassNotFoundException e) {
          processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, e.getMessage());
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.