public class CustomizableResourceBundleKeyGenerator extends java.lang.Object implements ResourceBundleKeyGenerator
| Modifier and Type | Field and Description |
|---|---|
static int |
minimumKeyMaximumLength |
| Constructor and Description |
|---|
CustomizableResourceBundleKeyGenerator()
Provides a
ResourceBundleKeyGenerator implementation can be customized
with respects to the minimum and maximum key length as well as the what number will be
used as the starting sequence if a key generated by this generator needs to have a number
attached to the end to provide a unique key. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
createKeyNameFromText(ResourceBundleWrapper resourceBundleWrapper,
java.lang.String string)
Creates a unique key for the given display string
|
int |
getKeyMaximumLength()
Gets the maximum length of a key
|
int |
getKeyMinimumLength()
Gets the minimum length of a key
|
int |
getSequenceStartsWith()
Gets the number to use as a starting piont for generating a unique
key when the key would otherwise not be unique.
|
void |
setKeyMaximumLength(int newkeyMaximumLength)
The key maximum length should be greater than 8 to keep key uniqueness.
|
void |
setKeyMinmumLength(int length)
Sets the minimum length of a key.
|
void |
setSequenceStartsWith(int newsequenceStartsWith)
Sets the number to use when generating a new sequence for a key that
would otherwise not be unique.
|
java.lang.String |
validateKeyNameFromText(ResourceBundleWrapper resourceBundleWrapper,
java.lang.String string) |
public CustomizableResourceBundleKeyGenerator()
ResourceBundleKeyGenerator implementation can be customized
with respects to the minimum and maximum key length as well as the what number will be
used as the starting sequence if a key generated by this generator needs to have a number
attached to the end to provide a unique key.public java.lang.String createKeyNameFromText(ResourceBundleWrapper resourceBundleWrapper, java.lang.String string)
createKeyNameFromText in interface ResourceBundleKeyGeneratorresourceBundleWrapper - the bundle to generate a key forstring - the string displayed to the userResourceBundleWrapperpublic java.lang.String validateKeyNameFromText(ResourceBundleWrapper resourceBundleWrapper, java.lang.String string)
validateKeyNameFromText in interface ResourceBundleKeyGeneratorpublic void setKeyMaximumLength(int newkeyMaximumLength)
newkeyMaximumLength - public int getKeyMaximumLength()
public void setKeyMinmumLength(int length)
the - minimum length of a keypublic int getKeyMinimumLength()
public void setSequenceStartsWith(int newsequenceStartsWith)
newsequenceStartsWith - number to use as the starting pointpublic int getSequenceStartsWith()