public class PropertyBuilder extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
m_sPrefixToSuppress
Prefix string that should be suppressed.
|
Constructor and Description |
---|
PropertyBuilder()
Construct a new PropertyBuilder.
|
PropertyBuilder(String sPrefix)
Construct a new PropertyBuilder that will suppress the given prefix
String.
|
Modifier and Type | Method and Description |
---|---|
ValueExtractor |
extractorFor(String sName)
Make a ValueExtractor for the given String.
|
ValueExtractor |
extractorFor(String[] asProps)
Make a ValueExtractor for the given array of property Strings.
|
String |
extractorStringFor(String sName)
Make a getter String suitable for use in a ValueExtractor.
|
String |
makeSimpleName(String sPrefix,
String sName)
Make a camel case String by prefixing a given String with a given
prefix.
|
String |
plainName(String sName)
Returns the specified method name with any "set" or
"get" prefix removed and the first letter of the
remaining String converted to lowercase.
|
String |
propertyStringFor(String sName)
Make a getter String suitable for use in a ValueUpdater.
|
String[] |
splitString(String sName,
char delim)
Take a given String and bust apart into a String array by splitting at
the given delimiter character.
|
protected String[] |
uniformArrayFor(String[] asProps,
String sPrefix)
Make a getter or setter String array from the given array of property
Strings usingthe given prefix string.
|
protected String |
uniformStringFor(String[] asParts)
Make a String from the given array of Strings parts.
|
ValueUpdater |
updaterFor(String sName)
Make a ValueUpdater for the given String.
|
ValueUpdater |
updaterFor(String[] asProps)
Make a ValueUpdater for the given array of property Strings.
|
String |
updaterStringFor(String sName)
Make a setter String suitable for use in a ValueUpdater.
|
protected String m_sPrefixToSuppress
public PropertyBuilder()
public PropertyBuilder(String sPrefix)
sPrefix
- the String to suppresspublic ValueExtractor extractorFor(String sName)
sName
- the String used to make ValueExtractorpublic String extractorStringFor(String sName)
sName
- the property String used to make getter Stringpublic String updaterStringFor(String sName)
sName
- the property String used to make setter Stringpublic String propertyStringFor(String sName)
sName
- the property String used to make getter Stringpublic ValueUpdater updaterFor(String sName)
sName
- the String used to make ValueExtractorpublic ValueExtractor extractorFor(String[] asProps)
asProps
- the String[] used to make ValueExtractorpublic ValueUpdater updaterFor(String[] asProps)
asProps
- the String[] used to make ValueUpdaterpublic String makeSimpleName(String sPrefix, String sName)
sPrefix
- the String to prefix, typically get or setsName
- the property String being transformedpublic String plainName(String sName)
sName
- the method name to convertprotected String[] uniformArrayFor(String[] asProps, String sPrefix)
asProps
- the String[] used to make getters or setterssPrefix
- the String to be prepended.protected String uniformStringFor(String[] asParts)
asParts
- the String[] used to make one string separated by '.'