Refine search
if (StringUtils.isEmpty(str) || delimLen == 0) { return str; return capitalize(str, delimiters);
public String capitalizeTrailingWords(String name) { char[] wordDelimiters = generationConfig.getPropertyWordDelimiters(); if (containsAny(name, wordDelimiters)) { String capitalizedNodeName; if (areAllWordsUpperCaseBesideDelimiters(name, wordDelimiters)) { capitalizedNodeName = WordUtils.capitalizeFully(name, wordDelimiters); } else { capitalizedNodeName = WordUtils.capitalize(name, wordDelimiters); } name = name.charAt(0) + capitalizedNodeName.substring(1); for (char c : wordDelimiters) { name = remove(name, c); } } else if (areAllWordsUpperCaseBesideDelimiters(name, wordDelimiters)) { name = WordUtils.capitalizeFully(name, wordDelimiters); } return name; }
@Override public String usage() { return WordUtils.wrap( String.format( "[--%s[=<%s>]]", name, exampleValue ), 60 ); }
if (isNotBlank(fileName) && isNotBlank(contents)) { throw new ParseException("Can not supply both a file (-n) and data (-d)"); if (isBlank(fileName) && isBlank(contents)) { throw new ParseException("Must supply either a file (-n) or data (-d)"); b.append(ansi().fg(Color.WHITE)).append(next.getLocationString()); String[] message = WordUtils.wrap(next.getMessage(), 80 - leftWidth, "\n", true).split("\\n"); for (String line : message) { b.append(App.LINESEP);
sp.setPath(cellValue(nextRow, colPath)); if (StringUtils.isNotBlank(sp.getName()) && !sp.getName().startsWith("!")) { if (sp.getType().equals("composite")) { compositeParams.add(sp); if (isNotBlank(targetTypes)) { for (String next : targetTypes.trim().split("\\s*,\\s*")) { if (isNotBlank(next)) { if (Character.isUpperCase(next.charAt(0))) { sp.addTargetType(next); composite.setType("composite"); composite.setCompositeOf(Arrays.asList(part1.getName(), part2.getName())); composite.setCompositeTypes(Arrays.asList(WordUtils.capitalize(part1.getType()), WordUtils.capitalize(part2.getType())));
public static String toLowerCamelCase(String s) { if (StringUtils.isBlank(s)) { return s.trim(); } return StringUtils.uncapitalize(StringUtils.deleteWhitespace(WordUtils.capitalizeFully(s))); }
private String toClassName(String theValue) { StringBuilder b = new StringBuilder(); for (String next : theValue.split("\\s+")) { next = next.trim(); if (StringUtils.isBlank(next)) { continue; } if (next.startsWith("(") && next.endsWith(")")) { continue; } next = next.replace("/", ""); next = next.replace("-", ""); next = next.replace(',', '_'); next = next.replace('.', '_'); if (next.contains(" ")) { next = WordUtils.capitalizeFully(next); } b.append(next); } b.append("Enum"); return b.toString(); }
public void generate(OutputStream outputStream) throws GenerationException, IOException, GraphUtilException { String cName = getName(); if (StringUtils.isBlank(cName)) { throw new GenerationException("could not detect name, please set explicitly"); } //noinspection ConstantConditions cName = WordUtils.capitalize(cName.replaceAll("\\W+", " ")).replaceAll("\\s+", ""); generate(cName, new PrintWriter(outputStream)); }
private String determineName(Method method) { SearchIndex annotation = method.getAnnotation(SearchIndex.class); String name = annotation == null ? null : annotation.value(); if (StringUtils.isBlank(name)) { name = method.getName(); if (name.startsWith("is")) { name = WordUtils.uncapitalize(name.substring(2)); } else if (name.startsWith("get")) { name = WordUtils.uncapitalize(name.substring(3)); } } return name; }
markupDocBuilder.sectionTitleWithAnchorLevel2(WordUtils.capitalize(tagName), tagName + "_resource"); String description = tag.getDescription(); if (StringUtils.isNotBlank(description)) { markupDocBuilder.paragraph(description); markupDocBuilder.sectionTitleWithAnchorLevel2(WordUtils.capitalize(header), header + "_resource"); operationsGroupedByRegex.get(header).forEach(operation -> buildOperation(markupDocBuilder, operation, config));
/** * Returns the statements key name from the statement enumeration constant. * * @param statementsEnum * the enumeration {@link Enum} constant. * * @return the statement key {@link String} name. */ public static String toString(Enum<?> statementsEnum) { String[] split = split(lowerCase(statementsEnum.name()), SEPERATOR); for (int i = 1; i < split.length - 1; i++) { split[i] = WordUtils.capitalize(split[i]); } String name = join(split, EMPTY, 0, split.length - 1); return name; }
/** * Converts a (nested) property name to an HQL argument name. * * For example getParameterName("yearlyDeclaration.survey.topiaId") → "yearlyDeclarationSurveyTopiaId" * * @param propertyName the name of a property, can be a path to a nested property * @return a string that can syntactically be used as an HQL parameter name, not prefixed by ':' */ protected String getParameterName(String propertyName) { Preconditions.checkArgument(StringUtils.isNotBlank(propertyName)); String capitalize = WordUtils.capitalize(propertyName, '.'); String withoutDots = capitalize.replaceAll("\\.", ""); String parameterName = StringUtils.uncapitalize(withoutDots); return parameterName; }
private static void initClasses(Set<String> enabled, HashMap<String, Triple<String, String, String>> moduleData) { for (String module: enabled) { Triple<String, String, String> data = moduleData.get(module); String dependencyList = data.getRight().replace(" ", ""); List<String> dependencies = Lists.newArrayList(dependencyList.split(",")); if (dependencyList.equals("") || enabled.containsAll(dependencies)) { try { ModuleManager.enabled.put(module, Class.forName(data.getLeft())); Mariculture.logger.log(Level.INFO, "Enabling the " + StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(WordUtils.capitalize(module)), ' ') + " " + data.getMiddle().replace("s", "") + "!"); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } } } }
@Override void runCmd() throws Exception { admin.functions().getConnectorsList().stream().filter(x -> isNotBlank(x.getSinkClass())) .forEach(connector -> { System.out.println(connector.getName()); System.out.println(WordUtils.wrap(connector.getDescription(), 80)); System.out.println("----------------------------------------"); }); } }
@Override void runCmd() throws Exception { admin.functions().getConnectorsList().stream().filter(x -> !StringUtils.isEmpty(x.getSourceClass())) .forEach(connector -> { System.out.println(connector.getName()); System.out.println(WordUtils.wrap(connector.getDescription(), 80)); System.out.println("----------------------------------------"); }); } }
public String getServiceName() { if (StringUtils.isEmpty(serviceName)) return WordUtils.uncapitalize(clazz.getEnclosingClass().getSimpleName()); return serviceName; }
private void fillBasics(StructureElement theElement, BaseRuntimeElementDefinition<?> def, LinkedList<String> path, BaseRuntimeDeclaredChildDefinition theChild) { if (path.isEmpty()) { path.add(def.getName()); theElement.setName(def.getName()); } else { path.add(WordUtils.uncapitalize(theChild.getElementName())); theElement.setName(theChild.getElementName()); } theElement.setPath(StringUtils.join(path, '.')); }
private static String convertToCamelCase(String inString) { String str = inString.trim(); if(StringUtils.contains(str, '-') || StringUtils.contains(str, ' ')) { str = inString.replace('-', ' '); str = WordUtils.capitalizeFully(str); str = StringUtils.deleteWhitespace(str); } return StringUtils.uncapitalize(str); }
/** * <p>Capitalizes all the whitespace separated words in a String. * Only the first character of each word is changed. To convert the * rest of each word to lowercase at the same time, * use {@link #capitalizeFully(String)}.</p> * * <p>Whitespace is defined by {@link Character#isWhitespace(char)}. * A <code>null</code> input String returns <code>null</code>. * Capitalization uses the Unicode title case, normally equivalent to * upper case.</p> * * <pre> * WordUtils.capitalize(null) = null * WordUtils.capitalize("") = "" * WordUtils.capitalize("i am FINE") = "I Am FINE" * </pre> * * @param str the String to capitalize, may be null * @return capitalized String, <code>null</code> if null String input * @see #uncapitalize(String) * @see #capitalizeFully(String) */ public static String capitalize(final String str) { return capitalize(str, null); }
/** * Convert column name to property name, for example, THIS_IS_1ST_COLUMN_$$ will become thisIs1stColumn * @param columnName label or name of the column * @return for example, THIS_IS_1ST_COLUMN_$$ will become thisIs1stColumn */ protected String columnNameToPropertyName(String columnName){ String normalized = columnName.replaceAll("[^a-zA-Z0-9]+", " "); String capitalized = WordUtils.capitalizeFully(normalized); String blankRemmoved = StringUtils.remove(capitalized, ' '); return StringUtils.uncapitalize(blankRemmoved); }