Package org.apache.avro.compiler.idl

Examples of org.apache.avro.compiler.idl.Idl.CompilationUnit()


      URLClassLoader projPathLoader = new URLClassLoader
          (runtimeUrls.toArray(new URL[0]), Thread.currentThread().getContextClassLoader());
        parser = new Idl(new File(sourceDirectory, filename), projPathLoader);

      Protocol p = parser.CompilationUnit();
      String json = p.toString(true);
      Protocol protocol = Protocol.parse(json);
      SpecificCompiler compiler = new SpecificCompiler(protocol);
      compiler.setStringType(GenericData.StringType.valueOf(stringType));
      compiler.setTemplateDir(templateDirectory);
View Full Code Here


  @Override
  protected void doCompile(String filename, File sourceDirectory, File outputDirectory) throws IOException {
    Idl parser = new Idl(new File(sourceDirectory, filename));
    try {
      Protocol p = parser.CompilationUnit();
      String json = p.toString(true);
      Protocol protocol = Protocol.parse(json);
      SpecificCompiler compiler = new SpecificCompiler(protocol);
      compiler.compileToDestination(null, outputDirectory);
    } catch (ParseException e) {
View Full Code Here

      URLClassLoader projPathLoader = new URLClassLoader
        (runtimeUrls, Thread.currentThread().getContextClassLoader());
        parser = new Idl(new File(sourceDirectory, filename), projPathLoader);
      }

      Protocol p = parser.CompilationUnit();
      String json = p.toString(true);
      Protocol protocol = Protocol.parse(json);
      SpecificCompiler compiler = new SpecificCompiler(protocol);
      compiler.setStringType(GenericData.StringType.valueOf(stringType));
      compiler.setTemplateDir(templateDirectory);
View Full Code Here

  @Override
  protected void doCompile(String filename, File sourceDirectory, File outputDirectory) throws IOException {
    Idl parser = new Idl(new File(sourceDirectory, filename));
    try {
      Protocol p = parser.CompilationUnit();
      String json = p.toString(true);
      Protocol protocol = Protocol.parse(json);
      SpecificCompiler compiler = new SpecificCompiler(protocol);
      compiler.compileToDestination(null, outputDirectory);
    } catch (ParseException e) {
View Full Code Here

      URLClassLoader projPathLoader = new URLClassLoader
        (runtimeUrls, Thread.currentThread().getContextClassLoader());
        parser = new Idl(new File(sourceDirectory, filename), projPathLoader);
      }

      Protocol p = parser.CompilationUnit();
      String json = p.toString(true);
      Protocol protocol = Protocol.parse(json);
      SpecificCompiler compiler = new SpecificCompiler(protocol);
      compiler.setStringType(GenericData.StringType.valueOf(stringType));
      compiler.setTemplateDir(templateDirectory);
View Full Code Here

   
    if (args.size() == 2 && ! "-".equals(args.get(1))) {
      parseOut = new PrintStream(new FileOutputStream(args.get(1)));
    }

    Protocol p = parser.CompilationUnit();
    parseOut.print(p.toString(true));
    return 0;
  }

  @Override
View Full Code Here

    boolean pretty = true;
    Idl parser = new Idl(new File(args.get(0)));
    File outputDirectory = getOutputDirectory(args);

    for (Schema schema : parser.CompilationUnit().getTypes()) {
      print(schema, outputDirectory, pretty);
    }
    parser.close();

    return 0;
View Full Code Here

      }
      URLClassLoader projPathLoader = new URLClassLoader
        (runtimeUrls, Thread.currentThread().getContextClassLoader());

      Idl parser = new Idl(new File(sourceDirectory, filename), projPathLoader);
      Protocol p = parser.CompilationUnit();
      String json = p.toString(true);
      Protocol protocol = Protocol.parse(json);
      SpecificCompiler compiler = new SpecificCompiler(protocol);
      compiler.setStringType(GenericData.StringType.valueOf(stringType));
      compiler.setTemplateDir(templateDirectory);
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.