Package yalp.templates.BaseTemplate

Examples of yalp.templates.BaseTemplate.RawData


        }
        return str;
    }

    public static RawData escapeHtml(String htmlToEscape) {
        return new RawData(HTML.htmlEscape(htmlToEscape));
    }
View Full Code Here


    public static String escapeJavaScript(String str) {
        return StringEscapeUtils.escapeJavaScript(str);
    }

    public static RawData raw(Object val) {
        return new RawData(val);
    }
View Full Code Here

        return new RawData(val);
    }

    public static RawData raw(Object val, Object condition) {
        if (eval(condition)) {
            return new RawData(val);
        }
        return new RawData("");
    }
View Full Code Here

    public static RawData asAttr(Map attributes, Object condition) {
        if (eval(condition)) {
            return asAttr(attributes);
        }
        return new RawData("");
    }
View Full Code Here

    public static RawData asAttr(Map attributes) {
        StringBuffer buf = new StringBuffer();
        for (Object key : attributes.keySet()) {
            buf.append(key + "=\"" + attributes.get(key) + "\" ");
        }
        return new RawData(buf);
    }
View Full Code Here

    public static String asdate(Long timestamp, String pattern, String lang, String timezone) {
        return format(new Date(timestamp), pattern, lang, timezone);
    }

    public static RawData nl2br(RawData data) {
        return new RawData(data.toString().replace("\n", "<br/>"));
    }
View Full Code Here

    public static RawData nl2br(RawData data) {
        return new RawData(data.toString().replace("\n", "<br/>"));
    }

    public static RawData nl2br(Object data) {
        return new RawData(HTML.htmlEscape(data.toString()).replace("\n", "<br/>"));
    }
View Full Code Here

TOP

Related Classes of yalp.templates.BaseTemplate.RawData

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.