ys.wikiparser
Class Utils
java.lang.Object
ys.wikiparser.Utils
public class Utils
- extends Object
|
Constructor Summary |
Utils()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Utils
public Utils()
isUrlChar
public static boolean isUrlChar(char c)
isLatinLetterOrDigit
public static boolean isLatinLetterOrDigit(char c)
preprocessWikiText
public static String preprocessWikiText(String text)
- Filters text so there are no '\r' chars in it ("\r\n" -> "\n"; then "\r" -> "\n").
Most importantly makes all blank lines (lines with only spaces) exactly like this: "\n\n".
WikiParser relies on that.
- Parameters:
text -
- Returns:
- filtered text
escapeHTML
public static String escapeHTML(String s)
unescapeHTML
public static String unescapeHTML(String value)
atoi
public static int atoi(String s)
atoi
public static int atoi(String s,
int base)
replaceString
public static String replaceString(String str,
String from,
String to)
split
public static String[] split(String s,
char separator)
translit
public static String translit(String s)
- Translates all non-basic-latin-letters characters into latin ones for use in URLs etc.
Here is the implementation for cyrillic (Russian) alphabet. Unknown characters are omitted.
- Parameters:
s - string to be translated
- Returns:
- translated string
emptyToNull
public static String emptyToNull(String s)
noNull
public static String noNull(String s)
noNull
public static String noNull(String s,
String val)
isEmpty
public static boolean isEmpty(String s)
Copyright © 2014 Mairie de Paris. All Rights Reserved.