java.lang.Object
uk.autores.naming.Namer
uk.autores.naming.IdiomaticNamer
Generates names that conform to Java naming conventions.
This implementation is more likely to generate name collisions than
Namer
.
Case handling uses Locale.ENGLISH
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionnameConstant
(String src) For input "foo-bar-baz" returns "FOO_BAR_BAZ".nameMember
(String src) For input "foo-bar-baz" returns "fooBarBaz".For input "foo-bar-baz" returns "FooBarBaz".Methods inherited from class uk.autores.naming.Namer
isIdentifier, isPackage, simplifyResourceName
-
Constructor Details
-
IdiomaticNamer
public IdiomaticNamer()Public no-args constructor as per contract.
-
-
Method Details
-
nameMember
For input "foo-bar-baz" returns "fooBarBaz".- Overrides:
nameMember
in classNamer
- Parameters:
src
- source string- Returns:
- lower snake case
-
nameConstant
For input "foo-bar-baz" returns "FOO_BAR_BAZ".- Overrides:
nameConstant
in classNamer
- Parameters:
src
- source string- Returns:
- upper snake case
-
nameType
For input "foo-bar-baz" returns "FooBarBaz".
-