Package com.dragome.compiler.utils

Examples of com.dragome.compiler.utils.FileObject


    //  }
  }

  private void pipeFileToStream(Writer writer, String relativeFilePath) throws IOException
  {
    FileObject fileObject= DragomeJsCompiler.compiler.fileManager.getFileForInput(relativeFilePath);
    String content;
    if (DragomeJsCompiler.compiler.isCompression())
    {
      JavaScriptCompressor compressor= new JavaScriptCompressor();
      content= compressor.compress(fileObject.openInputStream());
    }
    else
    {
      content= IOUtils.toString(fileObject.openInputStream());
    }
    writer.write(content);

    fileObject.close();
  }
View Full Code Here


    String className= args[0];
    DragomeJsCompiler.compiler= new DragomeJsCompiler(CompilerType.Standard);

    Project.createSingleton(null);
    ClassUnit classUnit= new ClassUnit(Project.singleton, Project.singleton.getSignature(className));
    classUnit.setClassFile(new FileObject(new File(args[1])));
    Parser parser= new Parser(classUnit);
    TypeDeclaration typeDecl= parser.parse();
    DragomeJavaScriptGenerator dragomeJavaScriptGenerator= new DragomeJavaScriptGenerator(Project.singleton);
    dragomeJavaScriptGenerator.setOutputStream(new PrintStream(new FileOutputStream(new File("/tmp/webapp.js"))));
    dragomeJavaScriptGenerator.visit(typeDecl);
View Full Code Here

TOP

Related Classes of com.dragome.compiler.utils.FileObject

Copyright © 2018 www.massapicom. 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.