Package org.stringtemplate.v4

Examples of org.stringtemplate.v4.AutoIndentWriter


                        ThriftServiceMetadata.class, serviceRenderer,
                        Requiredness.class, new FieldRequirednessRenderer()));
        ThriftContext ctx = new ThriftContext(packageName, ImmutableList.copyOf(includes.build()), thriftTypes, thriftServices, namespaceMap);
        ST template = tl.load("thriftfile");
        template.add("context", ctx);
        template.write(new AutoIndentWriter(outputStreamWriter));
        outputStreamWriter.flush();
    }
View Full Code Here


        }

        final File file = new File(folder, context.getJavaName() + ".java");

        try (OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(file), Charsets.UTF_8)) {
            template.write(new AutoIndentWriter(osw));
            osw.flush();
        }
    }
View Full Code Here

          .error("Could not create output directory {}", packageDir.getPath());
      return;
    }
    Writer fileWriter = new OutputStreamWriter(new FileOutputStream(new File(
        packageDir, classPrefix + fileName)), "UTF8");
    AutoIndentWriter writer = new AutoIndentWriter(fileWriter);
    writer.setLineWidth(80);
    enumST.write(writer);
    fileWriter.close();
  }
View Full Code Here

          .error("Could not create output directory {}", packageDir.getPath());
      return;
    }
    Writer fileWriter = new OutputStreamWriter(new FileOutputStream(new File(
        packageDir, fileName)), "UTF8");
    AutoIndentWriter writer = new AutoIndentWriter(fileWriter);
    writer.setLineWidth(80);
    enumST.write(writer);
    fileWriter.close();
  }
View Full Code Here

          .error("Could not create output directory {}", packageDir.getPath());
      return;
    }
    Writer fileWriter = new OutputStreamWriter(new FileOutputStream(new File(
        packageDir, classPrefix + fileName)), "UTF8");
    AutoIndentWriter writer = new AutoIndentWriter(fileWriter);
    writer.setLineWidth(80);
    enumST.write(writer);
    fileWriter.close();
  }
View Full Code Here

  }

  private void render(ST enumST, File packageDir, String typeName) throws IOException {
    Writer fileWriter = new OutputStreamWriter(
        new FileOutputStream(new File(packageDir, typeName + ".java")), UTF8);
    AutoIndentWriter writer = new AutoIndentWriter(fileWriter);
    writer.setLineWidth(80);
    enumST.write(writer);
    fileWriter.close();
  }
View Full Code Here

          .error("Could not create output directory {}", packageDir.getPath());
      return;
    }
    Writer fileWriter = new OutputStreamWriter(new FileOutputStream(new File(
        packageDir, camelCaseToUnderscore(typeName) + ".rb")), UTF8);
    AutoIndentWriter writer = new AutoIndentWriter(fileWriter);
    writer.setLineWidth(80);
    enumST.write(writer);
    fileWriter.close();
  }
View Full Code Here

      boolean debug = false;
      DebugInterpreter interp =
          new DebugInterpreter(outputFileST.groupThatCreatedThisInstance,
              outputFileST.impl.nativeGroup.errMgr,
              debug);
      InstanceScope scope = new InstanceScope(null, outputFileST);
      StringWriter sw = new StringWriter();
      AutoIndentWriter out = new AutoIndentWriter(sw);
      interp.exec(out, scope);

      for (String e : interp.evals) {
View Full Code Here

public class STModelAdaptor implements ModelAdaptor {
  public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName)
    throws STNoSuchPropertyException
  {
    ST st = (ST)o;
    return st.getAttribute(propertyName);
  }
View Full Code Here

      //System.out.println(event+"=="+((Wrapper)o).event+" is "+(this.event == ((Wrapper)o).event));
      return this.event == ((Wrapper)o).event;
    }

    public String toString() {
      ST st = event.scope.st;
      if ( st.isAnonSubtemplate() ) return "{...}";
      if ( st.debugState!=null && st.debugState.newSTEvent!=null ) {
        return st.toString()+" @ "+st.debugState.newSTEvent.getFileName()+":"+
             st.debugState.newSTEvent.getLine();
      }
      else {
        return st.toString();
      }
    }
View Full Code Here

TOP

Related Classes of org.stringtemplate.v4.AutoIndentWriter

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.