public class HtmlUtils extends Object
| Constructor and Description |
|---|
HtmlUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
applyLayout(Map<String,String> valuesMap,
String templateName) |
static String |
collectionToDelimitedString(Collection coll,
String delim,
String prefix,
String suffix) |
static String |
countAndDetail(List<String> items) |
static boolean |
generateBeginTable(org.apache.commons.lang3.text.StrBuilder sb,
int size)
Prints table start tag, or a message if table is empty.
|
static void |
generateEndTable(org.apache.commons.lang3.text.StrBuilder sb,
int size) |
static void |
generateHeaders(org.apache.commons.lang3.text.StrBuilder sb,
Object... cols)
Outputs table headers.
|
static void |
generateRow(org.apache.commons.lang3.text.StrBuilder sb,
String status,
Object... cols)
Outputs one table row.
|
static boolean |
isEmpty(Collection<?> collection)
Null-safe empty test for Collections.
|
static String |
json(String name,
Object o) |
public static String applyLayout(Map<String,String> valuesMap, String templateName) throws IOException
IOExceptionpublic static String collectionToDelimitedString(Collection coll, String delim, String prefix, String suffix)
public static boolean generateBeginTable(org.apache.commons.lang3.text.StrBuilder sb,
int size)
throws UnsupportedEncodingException,
IOException
size - IOExceptionUnsupportedEncodingExceptionpublic static void generateEndTable(org.apache.commons.lang3.text.StrBuilder sb,
int size)
throws UnsupportedEncodingException,
IOException
public static void generateHeaders(org.apache.commons.lang3.text.StrBuilder sb,
Object... cols)
WARNING : this method accepts HTML content as table headers. Any sensitive value must be encoded before calling this method.
sb - The target string builder.cols - Column titles (HTML).public static void generateRow(org.apache.commons.lang3.text.StrBuilder sb,
String status,
Object... cols)
throws IOException
WARNING : this method accepts HTML content as row content. Any sensitive value must be encoded before calling this method.
sb - The target string builder.status - status class name.cols - Column titles (HTML).IOExceptionpublic static boolean isEmpty(Collection<?> collection)
collection - Copyright © 2010–2016. All rights reserved.