Package net.ontopia.utils
Class StringUtils
java.lang.Object
net.ontopia.utils.StringUtils
INTERNAL: Class that contains useful string operation methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringINTERNAL: A string used internally for various control flow purposes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringescapeHTMLEntities(String value) INTERNAL: Filters the specified string for characters that are senstive to HTML interpreters, returning the string with these characters replaced by the corresponding character entities.static voidescapeHTMLEntities(String value, Writer out) INTERNAL: Filters the specified string for characters that are senstive to HTML interpreters, writing the string with these characters replaced by the corresponding character entities to the given writer.static StringmakeRandomId(int length) INTERNAL: Make a random ID-like string of the given number of characters.static StringnormalizeId(String name) INTERNAL: Creates a candidate ID from an input string.
-
Field Details
-
VERY_UNLIKELY_STRING
INTERNAL: A string used internally for various control flow purposes. It is a string that is extremely unlikely to occur in real-world data.- See Also:
-
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
escapeHTMLEntities
INTERNAL: Filters the specified string for characters that are senstive to HTML interpreters, returning the string with these characters replaced by the corresponding character entities.- Parameters:
value- The string to be filtered and returned- Since:
- 1.3.1
-
escapeHTMLEntities
INTERNAL: Filters the specified string for characters that are senstive to HTML interpreters, writing the string with these characters replaced by the corresponding character entities to the given writer.- Parameters:
value- The string to be filtered and written.- Throws:
IOException- Since:
- 3.0
-
makeRandomId
INTERNAL: Make a random ID-like string of the given number of characters. -
normalizeId
INTERNAL: Creates a candidate ID from an input string. The algorithm discards characters above U+00FF, strips accents off remaining characters, then discards everything that doesn't match the LTM NAME production (except leading characters, which turn into underscores). Whitespace is normalized, and turns into a hyphen when internal to the string. Letters are lowercased.
-