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.hibnet.jst.runtime.JstEscape.java

public static void unescape(final Writer out, final Object object, final boolean elvis) throws IOException {
    if (object != null) {
        out.append(object.toString());
    } else if (!elvis) {
        out.append("null");
    }// w w w .j a  va  2s  .co m
}

From source file:org.hibnet.jst.runtime.JstEscape.java

public static void escapeXml(final Writer out, final Object object, final boolean elvis) throws IOException {
    if (object != null) {
        out.append(StringEscapeUtils.escapeXml(object.toString()));
    } else if (!elvis) {
        out.append("null");
    }//w w w. ja va 2 s  . c  o m
}

From source file:org.hibnet.jst.runtime.JstEscape.java

public static void escapeHtml(final Writer out, final Object object, final boolean elvis) throws IOException {
    if (object != null) {
        out.append(StringEscapeUtils.escapeHtml(object.toString()));
    } else if (!elvis) {
        out.append("null");
    }//  w ww. ja va  2 s  . c  om
}

From source file:org.hibnet.jst.runtime.JstEscape.java

public static void escapeJs(final Writer out, final Object object, final boolean elvis) throws IOException {
    if (object != null) {
        out.append(StringEscapeUtils.escapeJavaScript(object.toString()));
    } else if (!elvis) {
        out.append("null");
    }/*  ww  w .  j  a  va2 s  .  c o m*/
}

From source file:org.hibnet.jst.runtime.JstEscape.java

public static void escapeJava(final Writer out, final Object object, final boolean elvis) throws IOException {
    if (object != null) {
        out.append(StringEscapeUtils.escapeJava(object.toString()));
    } else if (!elvis) {
        out.append("null");
    }/* www .  j  a  v  a2  s  .  c  om*/
}

From source file:org.hibnet.jst.runtime.JstEscape.java

public static void escapeCsv(final Writer out, final Object object, final boolean elvis) throws IOException {
    if (object != null) {
        out.append(StringEscapeUtils.escapeCsv(object.toString()));
    } else if (!elvis) {
        out.append("null");
    }//w w  w  .ja v a  2  s.c o m
}

From source file:org.hibnet.jst.runtime.JstEscape.java

public static void escapeSql(final Writer out, final Object object, final boolean elvis) throws IOException {
    if (object != null) {
        out.append(StringEscapeUtils.escapeSql(object.toString()));
    } else if (!elvis) {
        out.append("null");
    }/*w  w  w .  j a va2s. c  o m*/
}

From source file:nl.denhaag.tw.comparators.gui.ReportWriter.java

public static void write(Writer writer, CompareResult compareResult) throws IOException {
    writer.append("{");
    writer.append("\"title\": \"" + compareResult.toString() + "\", \"addClass\": \""
            + compareResult.getCssClass() + "\"");
    if (compareResult.getChildren().size() > 0) {
        writer.append(", \"isFolder\": true, \"expand\": true, \"children\": [");
        boolean first = true;
        for (CompareResult child : compareResult.getChildren()) {
            if (first) {
                first = false;/*from   w w w .ja v  a  2  s. c  o m*/
            } else {
                writer.append(",");
            }
            write(writer, child);
        }
        writer.append("]");
    }
    writer.append("}");
}

From source file:org.inaetics.remote.EndpointDescriptorWriter.java

private static void appendEndpoint(Writer writer, EndpointDescription endpoint) throws IOException {
    writer.append("  <endpoint-description>\n");
    for (Entry<String, Object> entry : endpoint.getProperties().entrySet()) {
        appendProperty(writer, entry.getKey(), entry.getValue());
    }//w w  w  .j  a  v a2 s .  c o m
    writer.append("  </endpoint-description>\n");
}

From source file:com.uksf.mf.core.utility.LogHandler.java

/**
 * Writes to file/*ww w  . ja  v  a  2s.c  om*/
 * @param log formatted message to write
 */
private static void toFile(String log) {
    try {
        Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(logFile, true)));
        writer.append(log).append("\n");
        writer.close();
    } catch (IOException e) {
        error(e);
    }
}