public class Utils extends Object
Common utilities.
Created by: Vladimir Nikic| Modifier and Type | Field and Description |
|---|---|
static String |
VAR_END |
static String |
VAR_START |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
appendAmpersandEscapedAttribute(StringBuilder writer,
String attributeName,
Map<String,String> tagAtttributes) |
static void |
appendEscapedAttribute(Appendable writer,
String attributeName,
Map<String,String> tagAtttributes) |
static String |
escapeXml(String s,
boolean advanced,
boolean recognizeUnicodeChars,
boolean translateSpecialEntities)
Escapes XML string.
|
static String |
escapeXmlChars(String s) |
static void |
escapeXmlToBuffer(String s,
Appendable result,
boolean advanced,
boolean recognizeUnicodeChars,
boolean translateSpecialEntities)
Escapes XML string into the given result buffer.
|
static void |
escapeXmlToBuffer(String s,
Appendable result,
boolean advanced,
boolean recognizeUnicodeChars,
boolean translateSpecialEntities,
boolean plainText)
Escapes XML string into the given result buffer.
|
static String |
evaluateTemplate(String template,
Map<String,String> variables)
Evaluates string template for specified map of variables.
|
static boolean |
isHexadecimalDigit(char ch) |
static String |
ltrim(String s)
Trims specified string from left.
|
static String |
ltrimNewline(String s)
Trims specified string from left and stop at
\n character |
static StringBuffer |
readUrl(URL url,
String charset)
Reads content from the specified URL with specified charset into string
|
static String |
rtrim(String s)
Trims specified string from right.
|
static String |
trimNewlineLeft(String s)
Trims specified string from left and stops at
\n character on
the left |
static String |
trimNewlineRight(String s)
Trims specified string from right and stops at
\n character on
the right |
public static String ltrimNewline(String s)
\n characters - public static String trimNewlineLeft(String s)
\n character on
the lefts - public static String trimNewlineRight(String s)
\n character on
the rights - public static StringBuffer readUrl(URL url, String charset) throws IOException
url - charset - IOExceptionpublic static boolean isHexadecimalDigit(char ch)
public static String escapeXml(String s, boolean advanced, boolean recognizeUnicodeChars, boolean translateSpecialEntities)
public static void escapeXmlToBuffer(String s, Appendable result, boolean advanced, boolean recognizeUnicodeChars, boolean translateSpecialEntities) throws IOException
IOExceptionpublic static void escapeXmlToBuffer(String s, Appendable result, boolean advanced, boolean recognizeUnicodeChars, boolean translateSpecialEntities, boolean plainText) throws IOException
IOExceptionpublic static void appendAmpersandEscapedAttribute(StringBuilder writer, String attributeName, Map<String,String> tagAtttributes)
public static void appendEscapedAttribute(Appendable writer, String attributeName, Map<String,String> tagAtttributes) throws IOException
IOExceptionpublic static String evaluateTemplate(String template, Map<String,String> variables)
template - Template stringvariables - Map of variables (can be null)Copyright © 2017 Java Wikipedia API (Bliki engine). All rights reserved.