| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final char[] | HEX_DIGITS
Hexadecimal characters |
| private static final Pattern | MAIL_PATTERN
Based on Markdown by John Gruber (https://daringfireball.net/projects/markdown/). |
| private static final Pattern | |
| private static final String | TITLECASE_STOPWORD_FOLLOWEDBY
Words that should not converted to title-case See stop-words.json |
| private static final Pattern[] | |
| private static final String | TLDs
Based on John Gruber's URL regex (https://gist.github.com/gruber/8891611 or https://daringfireball.net/2010/07/improved_regex_for_matching_urls) released under public domain. |
| private static final Pattern | |
| private static final Pattern |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: if the string contains only latin, common, or inherited charactersthe string to check s)Check if a string contains no other characters than those from the Unicode scripts "Latin", "Common", or "Inherited" |
| public static String | Returns: the escpaped stringthe string to escape s)Escapes characters in the given string according to Java rules |
| private static String | Returns: the stringthe character to convert c)Converts the given character to a four-digit hexadecimal string |
| public static String | Returns: the converted namethe name to convert name, String the string to append to each initial initializeWith)Parse the given name, split it into parts, and convert them to initials |
| public static String | Returns: the converted namethe name to convert name, String the string to append to each initial initializeWith, boolean true if only existing initials should be
normalized and uninitialized names should be kept as isParse the given name, split it into parts, and either convert them all to initials or only normalize existing initials |
| private static boolean | Returns: true if the string contains only uppercase charactersthe string s)Check if all characters in the given string are uppercase |
| public static int | Returns: the number of overlapping charactersthe first string a, CharSequence the second string b)Calculates how many characters overlap between |
| public static String | |
| private static boolean | Returns: true if the string should be capitalizedthe string s)Check if a string should be capitalized |
| private static boolean | |
| private static boolean | Returns: true if the letters in the given string are all uppercasethe string s)Check if all letters in the given string are uppercase |
| public static String | Returns: the converted stringthe string to convert str)Converts the words in a given string to title case (according to the CSL specification) |
| HEX_DIGITS | back to summary |
|---|---|
| private static final char[] HEX_DIGITS Hexadecimal characters | |
| MAIL_PATTERN | back to summary |
|---|---|
| private static final Pattern MAIL_PATTERN Based on Markdown by John Gruber (https://daringfireball.net/projects/markdown/). Released under a BSD-style license. | |
| POSSESSIVE_S_PATTERN | back to summary |
|---|---|
| private static final Pattern POSSESSIVE_S_PATTERN | |
| TITLECASE_STOPWORD_FOLLOWEDBY | back to summary |
|---|---|
| private static final String TITLECASE_STOPWORD_FOLLOWEDBY Words that should not converted to title-case See stop-words.json | |
| TITLECASE_STOPWORD_PATTERNS | back to summary |
|---|---|
| private static final Pattern[] TITLECASE_STOPWORD_PATTERNS | |
| TLDs | back to summary |
|---|---|
| private static final String TLDs Based on John Gruber's URL regex (https://gist.github.com/gruber/8891611 or https://daringfireball.net/2010/07/improved_regex_for_matching_urls) released under public domain. Slightly simplified. | |
| URL_PATTERN | back to summary |
|---|---|
| private static final Pattern URL_PATTERN | |
| WORD_PATTERN | back to summary |
|---|---|
| private static final Pattern WORD_PATTERN | |
| StringHelper | back to summary |
|---|---|
| public StringHelper() | |
| containsLatinScriptOnly | back to summary |
|---|---|
| public static boolean containsLatinScriptOnly(String s) Check if a string contains no other characters than those from the Unicode scripts "Latin", "Common", or "Inherited"
| |
| escapeJava | back to summary |
|---|---|
| public static String escapeJava(String s) Escapes characters in the given string according to Java rules | |
| hex4 | back to summary |
|---|---|
| private static String hex4(char c) Converts the given character to a four-digit hexadecimal string
| |
| initializeName | back to summary |
|---|---|
| public static String initializeName(String name, String initializeWith) Parse the given name, split it into parts, and convert them to initials | |
| initializeName | back to summary |
|---|---|
| public static String initializeName(String name, String initializeWith, boolean onlyNormalize) Parse the given name, split it into parts, and either convert them all to initials or only normalize existing initials | |
| isAllUppercase | back to summary |
|---|---|
| private static boolean isAllUppercase(String s) Check if all characters in the given string are uppercase
| |
| overlap | back to summary |
|---|---|
| public static int overlap(CharSequence a, CharSequence b) Calculates how many characters overlap between Examples:
overlap("abcd", "cdef") = 2
overlap("abcd", "xyz") = 0
overlap("a", "a") = 1
overlap("ab", "b") = 1
overlap("abcd", "bcdefg") = 3
overlap("", "a") = 0
overlap("a", "") = 0
| |
| sanitize | back to summary |
|---|---|
| public static String sanitize(String s) Sanitizes a string so it can be used as an identifier | |
| shouldCapitalize | back to summary |
|---|---|
| private static boolean shouldCapitalize(String s) Check if a string should be capitalized
| |
| shouldStopwordLowercase | back to summary |
|---|---|
| private static boolean shouldStopwordLowercase(String w, String str) | |
| titleAllUppercase | back to summary |
|---|---|
| private static boolean titleAllUppercase(String s) Check if all letters in the given string are uppercase
| |
| toTitleCase | back to summary |
|---|---|
| public static String toTitleCase(String str) Converts the words in a given string to title case (according to the CSL specification) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| alreadyInitialized | back to summary |
|---|---|
| pack-priv final boolean alreadyInitialized | |
| hyphen | back to summary |
|---|---|
| pack-priv final boolean hyphen | |
| part | back to summary |
|---|---|
| pack-priv final String part | |
| NamePart | back to summary |
|---|---|
| pack-priv NamePart(String part, boolean hyphen, boolean alreadyInitialized) | |