Example usage for java.io Writer append

List of usage examples for java.io Writer append

Introduction

In this page you can find the example usage for java.io Writer append.

Prototype

public Writer append(char c) throws IOException 

Source Link

Document

Appends the specified character to this writer.

Usage

From source file:org.sonar.plugins.checkstyle.CheckstyleProfileExporter.java

private void appendXmlHeader(Writer writer) throws IOException {
    writer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + DOCTYPE_DECLARATION
            + "<!-- Generated by Sonar -->" + "<module name=\"Checker\">");
}

From source file:org.sonar.plugins.ideainspections.IdeaProfileExporter.java

private void appendAttribute(Writer writer, String attr, String value) throws IOException {
    writer.append(" ").append(attr).append('=').append('"').append(value).append('"');
}

From source file:com.echosource.ada.rules.AdaProfileExporter.java

private void appendXmlFooter(Writer writer) throws IOException {
    writer.append("</module>");
}

From source file:org.sonar.plugins.csharp.stylecop.profiles.StyleCopProfileExporter.java

private void printEndOfFile(Writer writer) throws IOException {
    writer.append("    </Analyzers>\n");
    writer.append("</StyleCopSettings>");
}

From source file:com.echosource.ada.rules.AdaProfileExporter.java

private void appendXmlHeader(Writer writer) throws IOException {
    writer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    writer.append("<!DOCTYPE module PUBLIC \"-//Puppy Crawl//DTD Check Configuration ");
    writer.append("1.2//EN\" \"http://www.puppycrawl.com/dtds/configuration_1_2.dtd\">");
    writer.append("<!-- Generated by Sonar -->" + "<module name=\"Checker\">");
}

From source file:org.sonar.plugins.csharp.stylecop.profiles.StyleCopProfileExporter.java

private void printStartOfFile(Writer writer) throws IOException {
    writer.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n");
    writer.append("<StyleCopSettings Version=\"4.3\">\n");
    writer.append("    <Analyzers>\n");
}

From source file:com.github.rabid_fish.proxy.servlet.SoapServlet.java

void writeMathResult(Writer writer, int mathResult) throws IOException {

    writer.append(
            "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:mat=\"http://www.github.com/rabid-fish/math2/\">\n");
    writer.append("   <soapenv:Header/>\n");
    writer.append("   <soapenv:Body>\n");
    writer.append("      <mat:MathResponse>\n");
    writer.append("         <result>" + mathResult + "</result>\n");
    writer.append("      </mat:MathResponse>\n");
    writer.append("   </soapenv:Body>\n");
    writer.append("</soapenv:Envelope>\n");
}

From source file:com.github.rabid_fish.proxy.servlet.SoapServlet.java

void writeSoapError(Writer writer, String message) throws IOException {

    writer.append(
            "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:mat=\"http://www.github.com/rabid-fish/math2/\">\n");
    writer.append("   <soapenv:Header/>\n");
    writer.append("   <soapenv:Body>\n");
    writer.append("       <soapenv:Fault>\n");
    writer.append("           <faultcode>1</faultcode>\n");
    writer.append("           <faultstring>" + message + "</faultstring>\n");
    writer.append("       </soapenv:Fault>\n");
    writer.append("   </soapenv:Body>\n");
    writer.append("</soapenv:Envelope>\n");
}

From source file:org.sonar.plugins.csharp.gendarme.profiles.GendarmeProfileExporter.java

public void printRules(Writer writer, List<ActiveRule> rules) throws IOException {
    writer.append("<gendarme>\n");

    marshall(writer, rules, null);/*from   ww  w.j  a  v a 2s.  c o m*/

    RulePriority[] priorities = RulePriority.values();
    for (RulePriority rulePriority : priorities) {
        marshall(writer, rules, rulePriority);
    }

    writer.append("</gendarme>");
}

From source file:org.sonar.plugins.ideainspections.IdeaProfileExporter.java

private void appendParameters(Writer writer, ActiveRule activeRule) throws IOException {
    writer.append(">\n");

    for (RuleParam option : activeRule.getRule().getParams()) {
        String value = activeRule.getParameter(option.getKey());

        if (StringUtils.isNotBlank(value)) {
            writer.append("<").append(INSPECTION_OPTION_NODE);
            appendAttribute(writer, INSPECTION_OPTION_NAME_ATTR, option.getKey());
            appendAttribute(writer, INSPECTION_OPTION_VALUE_ATTR, value);
            writer.append("/>\n");
        }/*from www.  j av a 2s  . c  o  m*/
    }

    writer.append("</").append(INSPECTION_TOOL_NODE).append(">\n");
}