Examples of Jalopy


Examples of de.hunsicker.jalopy.Jalopy

   
    File outputDirFile = new File(_sourceDirectory, _outputPackage.replace('.', '/'));
   
    outputDirFile.mkdirs();

    Jalopy jalopy = new Jalopy();
   
    for (UserType type : registry.getTypes(UserType.class)) {
      if (type.getParentType() == null) {
        File file = new File(outputDirFile, type.getJavaType() + ".java");
        StringWriter stringWriter = new StringWriter();
       
        try {
          stringWriter.append("package ").append(_outputPackage).append(";\n\n");
          generator.generate(stringWriter, type);
          stringWriter.flush();

          StringBuffer buffer = new StringBuffer();
         
          jalopy.setInput(stringWriter.toString(), file.getPath());
          jalopy.setOutput(buffer);
         
          FileWriter writer = new FileWriter(file);
          if (jalopy.format() && Jalopy.State.PARSED == jalopy.getState()) {
            writer.write(buffer.toString());
          } else {
            writer.write(stringWriter.toString());
          }
          writer.close();
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.