Examples of IndentingWriter


Examples of com.android.dx.util.IndentingWriter

     * @param prefix {@code non-null;} prefix to attach to each line of output
     * @param verbose whether to be verbose; verbose output includes
     * lines for zero-size instructions and explicit constant pool indices
     */
    public void debugPrint(Writer out, String prefix, boolean verbose) {
        IndentingWriter iw = new IndentingWriter(out, 0, prefix);
        int sz = size();

        try {
            for (int i = 0; i < sz; i++) {
                DalvInsn insn = (DalvInsn) get0(i);
                String s;

                if ((insn.codeSize() != 0) || verbose) {
                    s = insn.listingString("", 0, verbose);
                } else {
                    s = null;
                }

                if (s != null) {
                    iw.write(s);
                }
            }

            iw.flush();
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }
View Full Code Here

Examples of com.android.dx.util.IndentingWriter

        try {
            if (w1 == 0) {
                int len2 = s2.length();
                StringWriter sw = new StringWriter(len2 * 2);
                IndentingWriter iw = new IndentingWriter(sw, w2, separator);

                iw.write(s2);
                if ((len2 == 0) || (s2.charAt(len2 - 1) != '\n')) {
                    iw.write('\n');
                }
                iw.flush();

                return sw.toString();
            } else {
                return TwoColumnOutput.toString(s1, w1, separator, s2, w2);
            }
View Full Code Here

Examples of com.sun.tools.internal.ws.processor.util.IndentingWriter

        File hcFile = new File(packageDir, hcName);

        options.addGeneratedFile(hcFile);

        try {
            IndentingWriter p =
                new IndentingWriter(
                    new OutputStreamWriter(new FileOutputStream(hcFile)));
            Transformer it = XmlUtil.newTransformer();

            it.setOutputProperty(OutputKeys.METHOD, "xml");
            it.setOutputProperty(OutputKeys.INDENT, "yes");
            it.setOutputProperty(
                "{http://xml.apache.org/xslt}indent-amount",
                "2");
            it.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
            it.transform( new DOMSource(hChains), new StreamResult(p) );
            p.close();
        } catch (Exception e) {
            throw new GeneratorException(
                    "generator.nestedGeneratorError",
                    e);
        }
View Full Code Here

Examples of com.sun.tools.internal.ws.processor.util.IndentingWriter

        File hcFile = new File(packageDir, hcName);

        options.addGeneratedFile(hcFile);

        try {
            IndentingWriter p =
                new IndentingWriter(
                    new OutputStreamWriter(new FileOutputStream(hcFile)));
            Transformer it = XmlUtil.newTransformer();

            it.setOutputProperty(OutputKeys.METHOD, "xml");
            it.setOutputProperty(OutputKeys.INDENT, "yes");
            it.setOutputProperty(
                "{http://xml.apache.org/xslt}indent-amount",
                "2");
            it.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
            it.transform( new DOMSource(hChains), new StreamResult(p) );
            p.close();
        } catch (Exception e) {
            throw new GeneratorException(
                    "generator.nestedGeneratorError",
                    e);
        }
View Full Code Here

Examples of com.sun.tools.ws.processor.util.IndentingWriter

        File hcFile = new File(packageDir, hcName);

        options.addGeneratedFile(hcFile);

        try {
            IndentingWriter p =
                new IndentingWriter(
                    new OutputStreamWriter(new FileOutputStream(hcFile)));
            Transformer it = XmlUtil.newTransformer();

            it.setOutputProperty(OutputKeys.METHOD, "xml");
            it.setOutputProperty(OutputKeys.INDENT, "yes");
            it.setOutputProperty(
                "{http://xml.apache.org/xslt}indent-amount",
                "2");
            it.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
            it.transform( new DOMSource(hChains), new StreamResult(p) );
            p.close();
        } catch (Exception e) {
            throw new GeneratorException(
                    "generator.nestedGeneratorError",
                    e);
        }
View Full Code Here

Examples of com.sun.tools.ws.processor.util.IndentingWriter

    private void generateHandlerChainFile(Element hChains, String name) {
       
        Filer filer = options.filer;

        try {
            IndentingWriter p;
            FileObject jfo;
            if (filer != null) {
                jfo = filer.createResource(StandardLocation.SOURCE_OUTPUT,
                        Names.getPackageName(name), getHandlerConfigFileName(name));
                options.addGeneratedFile(new File(jfo.toUri()));
                p = new IndentingWriter(new OutputStreamWriter(jfo.openOutputStream()));
            } else { // leave for backw. compatibility now
                String hcName = getHandlerConfigFileName(name);
                File packageDir = DirectoryUtil.getOutputDirectoryFor(name, destDir);
                File hcFile = new File(packageDir, hcName);
                options.addGeneratedFile(hcFile);
                p = new IndentingWriter(new OutputStreamWriter(new FileOutputStream(hcFile)));
            }
       
            Transformer it = XmlUtil.newTransformer();

            it.setOutputProperty(OutputKeys.METHOD, "xml");
            it.setOutputProperty(OutputKeys.INDENT, "yes");
            it.setOutputProperty(
                "{http://xml.apache.org/xslt}indent-amount",
                "2");
            it.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
            it.transform( new DOMSource(hChains), new StreamResult(p) );
            p.close();
        } catch (Exception e) {
            throw new GeneratorException(
                    "generator.nestedGeneratorError",
                    e);
        }
View Full Code Here

Examples of com.volantis.shared.io.IndentingWriter

        TestIntegrityCheckingReporter reporter =
                new TestIntegrityCheckingReporter();
        cache.performIntegrityCheck(reporter);
        StringBuffer issues = reporter.getIssues();
        if (issues != null) {
            IndentingWriter printer = new IndentingWriter(System.out);
            cache.debugStructure(printer);
            fail(issues.toString());
        }
    }
View Full Code Here

Examples of com.volantis.shared.io.IndentingWriter

                (delta.getMissedAddedCount() - delta.getRemovedCount()));
        System.out.println("Hit rate:               " + delta.getHitRate() + "%");

        System.out.println("Key count:              " + keys.size());

        cache.debugStructure(new IndentingWriter(System.out));

        // Make sure that the number of entries removed according to the
        // snapshot is equal to the number removed according to the listener.
        int notifiedRemovedCount = listener.getRemovedCount();
        System.out.println("Notified removed count: " + notifiedRemovedCount);
        assertEquals(delta.getRemovedCount(), notifiedRemovedCount);

        if (logger.isDebugEnabled()) {
            StringWriter writer = new StringWriter();
            IndentingWriter printer = new IndentingWriter(writer);
            cache.debugStructure(printer);
            logger.debug(writer.toString());
        }
    }
View Full Code Here

Examples of info.aduna.io.IndentingWriter

   *
   * @param writer
   *        The Writer to write the Turtle document to.
   */
  public TurtleWriter(Writer writer) {
    this.writer = new IndentingWriter(writer);
    namespaceTable = new LinkedHashMap<String, String>();
    writingStarted = false;
    statementClosed = true;
    lastWrittenSubject = null;
    lastWrittenPredicate = null;
View Full Code Here

Examples of info.aduna.io.IndentingWriter

   *--------------*/

  public SPARQLResultsJSONWriter(OutputStream out) {
    Writer w = new OutputStreamWriter(out, Charset.forName("UTF-8"));
    w = new BufferedWriter(w, 1024);
    writer = new IndentingWriter(w);
  }
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.