/** * <p>Uncapitalizes all the whitespace separated words in a String. * Only the first letter of each word is changed.</p> * * <p>Whitespace is defined by {@link Character#isWhitespace(char)}. * A <code>null</code> input String returns <code>null</code>.</p> * * <pre> * WordUtils.uncapitalize(null) = null * WordUtils.uncapitalize("") = "" * WordUtils.uncapitalize("I Am FINE") = "i am fINE" * </pre> * * @param str the String to uncapitalize, may be null * @return uncapitalized String, <code>null</code> if null String input * @see #capitalize(String) */ public static String uncapitalize(String str) { return uncapitalize(str, null); }
public static String toCamelCase(String str) { return WordUtils.uncapitalize(str); }
public static String toCamelCase(String str) { return WordUtils.uncapitalize(str); }
/** * <p>Uncapitalizes all the whitespace separated words in a String. * Only the first letter of each word is changed.</p> * * <p>Whitespace is defined by {@link Character#isWhitespace(char)}. * A <code>null</code> input String returns <code>null</code>.</p> * * <pre> * WordUtils.uncapitalize(null) = null * WordUtils.uncapitalize("") = "" * WordUtils.uncapitalize("I Am FINE") = "i am fINE" * </pre> * * @param str the String to uncapitalize, may be null * @return uncapitalized String, <code>null</code> if null String input * @see #capitalize(String) */ public static String uncapitalize(String str) { return uncapitalize(str, null); }
/** * <p>Uncapitalizes all the whitespace separated words in a String. * Only the first letter of each word is changed.</p> * * <p>Whitespace is defined by {@link Character#isWhitespace(char)}. * A <code>null</code> input String returns <code>null</code>.</p> * * <pre> * WordUtils.uncapitalize(null) = null * WordUtils.uncapitalize("") = "" * WordUtils.uncapitalize("I Am FINE") = "i am fINE" * </pre> * * @param str the String to uncapitalize, may be null * @return uncapitalized String, <code>null</code> if null String input * @see #capitalize(String) */ public static String uncapitalize(String str) { return uncapitalize(str, null); }
/** * <p>Uncapitalizes all the whitespace separated words in a String. * Only the first letter of each word is changed.</p> * * <p>Whitespace is defined by {@link Character#isWhitespace(char)}. * A <code>null</code> input String returns <code>null</code>.</p> * * <pre> * WordUtils.uncapitalize(null) = null * WordUtils.uncapitalize("") = "" * WordUtils.uncapitalize("I Am FINE") = "i am fINE" * </pre> * * @param str the String to uncapitalize, may be null * @return uncapitalized String, <code>null</code> if null String input * @see #capitalize(String) */ public static String uncapitalize(String str) { return uncapitalize(str, null); }
/** * <p>Uncapitalizes all the whitespace separated words in a String. * Only the first letter of each word is changed.</p> * * <p>Whitespace is defined by {@link Character#isWhitespace(char)}. * A <code>null</code> input String returns <code>null</code>.</p> * * <pre> * WordUtils.uncapitalize(null) = null * WordUtils.uncapitalize("") = "" * WordUtils.uncapitalize("I Am FINE") = "i am fINE" * </pre> * * @param str the String to uncapitalize, may be null * @return uncapitalized String, <code>null</code> if null String input * @see #capitalize(String) */ public static String uncapitalize(String str) { return uncapitalize(str, null); }
/** * <p>Uncapitalizes all the whitespace separated words in a String. * Only the first letter of each word is changed.</p> * * <p>Whitespace is defined by {@link Character#isWhitespace(char)}. * A <code>null</code> input String returns <code>null</code>.</p> * * <pre> * WordUtils.uncapitalize(null) = null * WordUtils.uncapitalize("") = "" * WordUtils.uncapitalize("I Am FINE") = "i am fINE" * </pre> * * @param str the String to uncapitalize, may be null * @return uncapitalized String, <code>null</code> if null String input * @see #capitalize(String) */ public static String uncapitalize(String str) { return uncapitalize(str, null); }
private static String eliminatePrefix( final String propertyMethodNameWithPrefix, final String prefix) { final String methodNameWithoutGet = propertyMethodNameWithPrefix.substring(prefix.length()); final String propertyMethodName = WordUtils.uncapitalize(methodNameWithoutGet); return propertyMethodName; }
private static String extractPropertyName(final String identifier) { if (identifier.startsWith("get")) { final String methodName = identifier.substring(3); if (methodName.length() > 0) { return WordUtils.uncapitalize(methodName); } } return null; }
private static String extractPropertyName(final String identifier) { if (identifier.startsWith("get")) { final String methodName = identifier.substring(3); if (methodName.length() > 0) { return WordUtils.uncapitalize(methodName); } } return null; }
private String simpleUniqueConstraintError(Identifiable<?> entity, String property) { return WordUtils.uncapitalize(jpaUtil.getEntityName(entity)) + "_" + property + "_already_exists"; }
private String simpleUniqueConstraintError(Identifiable<?> entity, String property) { return WordUtils.uncapitalize(jpaUtil.getEntityName(entity)) + "_" + property + "_already_exists"; }
/** * Changes string with following convention: * <ul> * <li>Changes '-' -> '_' * <li>remove space characters and make first letter word uppercase: 'some * string' -> 'someString' * </ul> * If input string does not contains a whitespace than return unchanged. * * @param in an input string to convert to Java code convention * @return the correctly formatter string as per Java spec. */ public static String implementJavaNaming(String in) { in = in.trim().replaceAll("-", "_"); // If no white chars found inside a string return uncapitalized if (in.trim().matches("\\S+")) { return WordUtils.uncapitalize(in); } in = in.toLowerCase(); if (Pattern.matches("\\S+(\\s+\\S+)+", in)) { String[] words = in.split("\\s", 2); in = words[0] + WordUtils.capitalize(words[1]).replaceAll("\\s", ""); } return in; }
private FieldMetaData getFieldName(String methName, ClassMetaData cmd) { FieldMetaData res = null; String fieldName = null; if (methName.matches(IGNORE_METHODS_REGEX)) { return res; } else if (methName.startsWith("pcGet")) { // field access fieldName = methName.substring(5); } else if (methName.toLowerCase(Locale.ENGLISH).startsWith("get")) { // property access fieldName = WordUtils.uncapitalize(methName.substring(3)); } else if (methName.startsWith("pcis")) { fieldName = methName.substring(4).toLowerCase(Locale.ENGLISH); } for (FieldMetaData fmd : cmd.getDeclaredFields()) { String fmdName = fmd.getName(); if (fmdName.equals(fieldName)) { return fmd; } } return null; } }
private String compositeUniqueConstraintErrorCode(Identifiable<?> entity, UniqueConstraint uniqueConstraint) { return WordUtils.uncapitalize(jpaUtil.getEntityName(entity)) + "_" + (uniqueConstraint.name() == null ? "composite_unique_constraint_error" : uniqueConstraint.name().toLowerCase()); }
item = WordUtils.uncapitalize(item.substring(end.length()));
private static String renderJavaName(String name, String keywordSuffix, boolean firstCharLowerCase) { // First, strip off any custom suffix if (name.endsWith("__c") || name.endsWith("__r")) { name = name.substring(0, name.length() - CUSTOM_POSTFIX_LENGTH); } // Convert to camelCase name = WordUtils.capitalize(name, new char[]{'_'}); //Remove all underscores ('_') name = name.replace("_", ""); // If the name we're going to generate is a Java keyword // then we'll tweak it with the suffix argument if (SourceVersion.isKeyword(name.toLowerCase())) { name = name + keywordSuffix; } // Enforce the desired case on the first character if (firstCharLowerCase) { name = WordUtils.uncapitalize(name); } else { name = WordUtils.capitalize(name); } return name; } }
private String compositeUniqueConstraintErrorCode(Identifiable<?> entity, UniqueConstraint uniqueConstraint) { return WordUtils.uncapitalize(jpaUtil.getEntityName(entity)) + "_" + (uniqueConstraint.name() == null ? "composite_unique_constraint_error" : uniqueConstraint.name().toLowerCase()); }