private static String toCamelCase(final String rawString) { checkArgument(rawString != null, "String should not be null"); Iterable<String> components = CAMEL_SPLITTER.split(rawString); StringBuilder builder = new StringBuilder(); for (String comp : components) { builder.append(toFirstUpper(comp)); } return checkNumericPrefix(builder.toString()); }
public static String getClassName(final String localName) { checkArgument(localName != null, "Name should not be null."); return toFirstUpper(toCamelCase(localName)); }
/** * Creates the name of the getter method name from <code>localName</code>. * * @param localName * string with the name of the getter method * @param returnType * return type * @return string with the name of the getter method for * <code>methodName</code> in JAVA method format */ public static String getterMethodName(final String localName, final Type returnType) { final StringBuilder method = new StringBuilder(); if (BOOLEAN.equals(returnType)) { method.append("is"); } else { method.append("get"); } final String name = BindingMapping.toFirstUpper(BindingMapping.getPropertyName(localName)); method.append(name); return method.toString(); }
public static String getClassName(final QName name) { checkArgument(name != null, "Name should not be null."); return toFirstUpper(toCamelCase(name.getLocalName())); }