org.apache.cayenne.util
Class NameConverter

java.lang.Object
  extended by org.apache.cayenne.util.NameConverter

public class NameConverter
extends Object

Utility class to convert from different naming styles to Java convention. For example names like "ABCD_EFG" can be converted to "abcdEfg".


Constructor Summary
NameConverter()
           
 
Method Summary
static String javaToUnderscored(String name)
          Converts a String name to a String forllowing java convention for the static final variables.
static String specialCharsToJava(String string)
          Replaces special chars with human-readable and Java-id-compatible symbols.
static String underscoredToJava(String name, boolean capitalize)
          Converts names like "ABCD_EFG_123" to Java-style names like "abcdEfg123".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NameConverter

public NameConverter()
Method Detail

javaToUnderscored

public static String javaToUnderscored(String name)
Converts a String name to a String forllowing java convention for the static final variables. E.g. "abcXyz" will be converted to "ABC_XYZ".

Since:
1.0.3

underscoredToJava

public static String underscoredToJava(String name,
                                       boolean capitalize)
Converts names like "ABCD_EFG_123" to Java-style names like "abcdEfg123". If capitalize is true, returned name is capitalized (for instance if this is a class name).

Since:
1.2

specialCharsToJava

public static String specialCharsToJava(String string)
Replaces special chars with human-readable and Java-id-compatible symbols.



Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.