|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.umber.core.util.PropertyName
Helper class to convert a property name into various forms. Includes case-delimited ("PropertyName"), bean-property ("propertyName"), hyphenated ("property-name"), underscored ("property_name"), and underscore-caps ("PROPERTY_NAME").
Nested Class Summary | |
static class |
PropertyName.PropertyStyle
Enumeration for property naming styles. |
Field Summary | |
static PropertyName.PropertyStyle |
CASE_DELIM_STYLE
Property formatting style for case-delimited names, e.g., MyProperty |
static PropertyName.PropertyStyle |
DEFAULT_STYLE
Default property formatting style |
static PropertyName.PropertyStyle |
JAVABEAN_STYLE
Property formatting style for JavaBean names, e.g., myProperty |
static PropertyName.PropertyStyle |
LOWER_HYPHEN_STYLE
Property formatting style for lowercase hyphen-separated names, e.g., my-property |
static PropertyName.PropertyStyle |
LOWER_UNDERSCORE_STYLE
Property formatting style for lowercase underscore-separated names, e.g., my_property |
static PropertyName.PropertyStyle |
UPPER_HYPHEN_STYLE
Property formatting style for uppercase hyphen-separated names, e.g., MY-PROPERTY |
static PropertyName.PropertyStyle |
UPPER_UNDERSCORE_STYLE
Property formatting style for uppercase underscore-separated names, e.g., MY_PROPERTY |
Constructor Summary | |
PropertyName(java.lang.String propertyName)
Creates a new instance of PropertyName. |
Method Summary | |
static java.lang.String |
applyStyle(java.lang.String name,
PropertyName.PropertyStyle style)
Converts the name to the requested naming style. |
java.lang.String |
getBeanPropertyName()
Returns the property name in JavaBean property format, e.g., "propertyName". |
java.lang.String |
getCaseDelimitedName()
Returns the property name in case-delimited format, e.g., "PropertyName". |
java.lang.String |
getLowerHyphenatedName()
Returns the property name in hyphenated format, e.g., "property-name". |
java.lang.String |
getLowerUnderscoredName()
Returns the property name in underscored format, e.g., "property_name". |
java.lang.String |
getPropertyName()
Returns the original property name. |
java.lang.String |
getUpperHyphenatedName()
Returns the property name in hyphenated format, e.g., "property-name". |
java.lang.String |
getUpperUnderscoredName()
Returns the property name in underscored all-caps format, e.g., "PROPERTY_NAME". |
java.lang.String |
toString()
Returns a stringified version of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final PropertyName.PropertyStyle LOWER_HYPHEN_STYLE
public static final PropertyName.PropertyStyle LOWER_UNDERSCORE_STYLE
public static final PropertyName.PropertyStyle UPPER_HYPHEN_STYLE
public static final PropertyName.PropertyStyle UPPER_UNDERSCORE_STYLE
public static final PropertyName.PropertyStyle CASE_DELIM_STYLE
public static final PropertyName.PropertyStyle JAVABEAN_STYLE
public static final PropertyName.PropertyStyle DEFAULT_STYLE
Constructor Detail |
public PropertyName(java.lang.String propertyName)
propertyName
- the name of the propertyMethod Detail |
public static java.lang.String applyStyle(java.lang.String name, PropertyName.PropertyStyle style)
name
- the name to convertstyle
- the naming style
public java.lang.String getPropertyName()
public java.lang.String getCaseDelimitedName()
public java.lang.String getBeanPropertyName()
public java.lang.String getLowerHyphenatedName()
public java.lang.String getLowerUnderscoredName()
public java.lang.String getUpperHyphenatedName()
public java.lang.String getUpperUnderscoredName()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |