public class CamelCaseFormatter
extends java.lang.Object
For the purposes of application of camel case rules, any code point which has no case is considered to be the same case as the preceding letter.
Modifier and Type | Class and Description |
---|---|
static class |
CamelCaseFormatter.UnformattingCase
Treatment of case when unformatting from camel case to separate words.
|
Constructor and Description |
---|
CamelCaseFormatter()
Construct a formatter which
delimits over
whitespace, which does not format camel case with a
leading upper case character , and which
unformats camel case with case preserved . |
CamelCaseFormatter(java.lang.String delimiter,
boolean leadingCapital,
CamelCaseFormatter.UnformattingCase unformattingCase)
Construct a formatter with the given settings.
|
CamelCaseFormatter(java.lang.String canonicalDelimiter,
java.util.regex.Pattern delimiterPattern,
boolean leadingCapital,
CamelCaseFormatter.UnformattingCase unformattingCase)
Construct a formatter with the given settings.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
format(java.lang.String words) |
java.lang.String |
getCanonicalDelimiter() |
java.util.regex.Pattern |
getDelimiterPattern() |
CamelCaseFormatter.UnformattingCase |
getUnformattingCase() |
boolean |
isLeadingCapital() |
java.lang.String |
join(java.util.List<java.lang.String> words) |
java.util.List<java.lang.String> |
split(java.lang.String string) |
java.lang.String |
unformat(java.lang.String string) |
public CamelCaseFormatter()
delimits
over
whitespace, which does not format camel case with a
leading upper case character
, and which
unformats camel case with case preserved
.public CamelCaseFormatter(java.lang.String delimiter, boolean leadingCapital, CamelCaseFormatter.UnformattingCase unformattingCase)
formatting
than
a delimiter pattern.delimiter
- the delimiter string
leadingCapital
- the leading capital
settingunformattingCase
- the unformatting case
strategypublic CamelCaseFormatter(java.lang.String canonicalDelimiter, java.util.regex.Pattern delimiterPattern, boolean leadingCapital, CamelCaseFormatter.UnformattingCase unformattingCase)
canonicalDelimiter
- the canonical delimiter string
delimiterPattern
- the delimiter pattern
leadingCapital
- the leading capital
settingunformattingCase
- the unformatting case
strategypublic java.lang.String getCanonicalDelimiter()
unformatting
camel case stringspublic java.util.regex.Pattern getDelimiterPattern()
formatting
strings into camel casepublic boolean isLeadingCapital()
public CamelCaseFormatter.UnformattingCase getUnformattingCase()
unformatting case
strategy for this
formatterpublic java.lang.String join(java.util.List<java.lang.String> words)
words
- a sequence of words in a listleading capital
if specifiedpublic java.util.List<java.lang.String> split(java.lang.String string)
string
- a string in camel case formatunformatting case
public java.lang.String format(java.lang.String words)
words
- a sequence of words separated by the delimiter pattern
leading capital
if specifiedpublic java.lang.String unformat(java.lang.String string)
string
- a string in camel case formatunformatting case
, then joined about
the delimiter string