java.lang.Object | |
↳ | org.apache.commons.betwixt.strategy.HyphenatedNameMapper |
A name mapper which converts types to a hypenated String. So
a bean type of FooBar will be converted to the element name "foo-bar".
The name mapper can be configured to convert to upper case and to
use a different separator via the separator
and
upperCase
properties, so that FooBar can be converted
to FOO_BAR if needed, by calling the constructor
new HyphenatedNameMapper(true, "_")
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct a hyphenated name mapper that converts the name to lower case
and uses the default separator.
| |||||||||||
Construct a hyphenated name mapper with default separator.
| |||||||||||
Construct a hyphenated name mapper.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This separator will be inserted between the words in the bean name.
| |||||||||||
Should the bean name be converted to upper case? Otherwise, it will be converted to lower case. | |||||||||||
The words within the bean name are deduced assuming the first-letter-capital (for example camel's hump) naming convention. | |||||||||||
Sets the separator used to seperate words, which defaults to '-'
| |||||||||||
Sets whether upper or lower case conversions should be performed,
which defaults to false for lower case.
| |||||||||||
Outputs brief description.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Performs type conversion on the given character based on whether
upper or lower case conversions are being used
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.apache.commons.betwixt.strategy.NameMapper
|
Construct a hyphenated name mapper that converts the name to lower case and uses the default separator.
Construct a hyphenated name mapper with default separator.
upperCase | should the type name be converted (entirely) to upper case |
---|
Construct a hyphenated name mapper.
upperCase | should the type name be converted (entirely) to upper case |
---|---|
separator | use this string to separate the words in the name returned. The words in the bean name are deduced by relying on the standard camel's hump property naming convention. |
This separator will be inserted between the words in the bean name.
Should the bean name be converted to upper case?
Otherwise, it will be converted to lower case.
The words within the bean name are deduced assuming the
first-letter-capital (for example camel's hump) naming convention. For
example, the words in FooBar
are foo
and bar
.
Next convert all letter in the bean name to either upper case or lower case
based on the isUpperCase()
property value.
Then the getSeparator()
property value is inserted so that it separates
each word.
typeName | The name string to convert. If a JavaBean class name, should included only the last part of the name rather than the fully qualified name (e.g. FooBar rather than org.example.FooBar). |
---|
Sets the separator used to seperate words, which defaults to '-'
separator | the string inserted to separate words |
---|
Sets whether upper or lower case conversions should be performed, which defaults to false for lower case.
upperCase | whether the name is to be converted to upper case |
---|
Performs type conversion on the given character based on whether upper or lower case conversions are being used
ch | the character to be converted |
---|
isUpperCase()
otherwise to lower case