Example usage for java.lang Appendable append

List of usage examples for java.lang Appendable append

Introduction

In this page you can find the example usage for java.lang Appendable append.

Prototype

Appendable append(char c) throws IOException;

Source Link

Document

Appends the specified character to this Appendable .

Usage

From source file:org.ramadda.util.HtmlUtils.java

/**
 * _more_/* w w w  .ja va2s. c  o m*/
 *
 * @param sb _more_
 * @param s _more_
 *
 * @return _more_
 */
public static Appendable padRight(Appendable sb, String s) {
    try {
        sb.append(s);
        sb.append(space(1));
    } catch (IOException ioe) {
        throw new RuntimeException(ioe);
    }

    return sb;
}

From source file:org.ramadda.util.HtmlUtils.java

/**
 * _more_//from   ww  w.j a va 2s .c  o m
 *
 * @param js _more_
 * @param s _more_
 */
public static void script(Appendable js, String s) {
    try {
        js.append("\n<nowiki>\n");
        js.append(tag(TAG_SCRIPT, attrs(ATTR_TYPE, "text/JavaScript"), s));
        js.append("\n</nowiki>\n");
    } catch (IOException ioe) {
        throw new RuntimeException(ioe);
    }

}

From source file:org.ramadda.util.HtmlUtils.java

/**
 * _more_/*from ww  w  .  j av  a 2s .c om*/
 *
 * @param sb _more_
 * @param s _more_
 *
 *
 * @return _more_
 */
public static Appendable squote(Appendable sb, String s) {
    try {
        sb.append("'");
        sb.append(s);
        sb.append("'");
    } catch (IOException ioe) {
        throw new RuntimeException(ioe);
    }

    return sb;
}

From source file:org.ramadda.util.HtmlUtils.java

/**
 * _more_/*w  w w.j a va2  s  .c om*/
 *
 * @param sb _more_
 * @param comp _more_
 */
public static void dangleOpen(Appendable sb, String comp) {
    try {
        sb.append("<");
        sb.append(comp);
    } catch (IOException ioe) {
        throw new RuntimeException(ioe);
    }

}

From source file:org.ramadda.util.HtmlUtils.java

/**
 * _more_//from   w  w w.  ja  v a  2  s .co m
 *
 * @param s _more_
 * @param sb _more_
 *
 *
 * @return _more_
 */
public static Appendable quote(Appendable sb, String s) {
    try {
        sb.append("\"");
        s = s.replaceAll("\"", "\\\"");
        sb.append(s);
        sb.append("\"");
    } catch (IOException ioe) {
        throw new RuntimeException(ioe);
    }

    return sb;
}

From source file:org.ramadda.util.HtmlUtils.java

/**
 * _more_//from  w  ww .j ava2 s  .  c  o m
 *
 * @param sb _more_
 * @param jsUrl _more_
 */
public static void importJS(Appendable sb, String jsUrl) {
    try {
        sb.append(tag(TAG_SCRIPT, attrs(ATTR_SRC, jsUrl, ATTR_TYPE, "text/JavaScript"), ""));
        sb.append("\n");
    } catch (IOException ioe) {
        throw new RuntimeException(ioe);
    }
}

From source file:org.ramadda.util.HtmlUtils.java

/**
 * _more_/*from  ww w .java 2s.c o  m*/
 *
 * @param sb _more_
 * @param comp _more_
 *
 * @return _more_
 */
public static Appendable close(Appendable sb, String comp) {
    try {
        sb.append("</");
        sb.append(comp);
        sb.append(">");
    } catch (IOException ioe) {
        throw new RuntimeException(ioe);
    }

    return sb;
}

From source file:org.ramadda.util.HtmlUtils.java

/**
 * _more_/* w  ww . java 2  s.com*/
 *
 * @param sb _more_
 * @param comp _more_
 *
 * @return _more_
 */
public static Appendable tag(Appendable sb, String comp) {
    try {
        sb.append("<");
        sb.append(comp);
        sb.append("/>");
    } catch (IOException ioe) {
        throw new RuntimeException(ioe);
    }

    return sb;
}

From source file:org.ramadda.util.HtmlUtils.java

/**
 * _more_//  w  w  w. ja  v  a2  s. c  o  m
 *
 * @param name _more_
 * @param value _more_
 * @param sb _more_
 *
 */
public static void attr(Appendable sb, String name, String value) {
    try {
        sb.append(" ");
        sb.append(name);
        sb.append("=");
        quote(sb, value);
        sb.append(" ");
    } catch (IOException ioe) {
        throw new RuntimeException(ioe);
    }
}

From source file:org.ramadda.util.HtmlUtils.java

/**
 * _more_/*from www  . j ava2 s . c  om*/
 *
 * @param sb _more_
 * @param comp _more_
 * @param attrs _more_
 *
 * @return _more_
 */
public static Appendable tag(Appendable sb, String comp, String attrs) {
    try {
        sb.append("<");
        sb.append(comp);
        sb.append(attrs);
        sb.append("/>");
    } catch (IOException ioe) {
        throw new RuntimeException(ioe);
    }

    return sb;
}