/** * Convert potentially plural name to singular form. * * @param name base name * @return singularized name */ public String depluralize(String name) { return NameUtilities.depluralize(name); }
/** * Match class name against pattern. * * @param name * @return <code>true</code> if name matches pattern, <code>false</code> if not */ protected boolean matchName(String name) { if (m_matchName != null) { return NameUtilities.isPatternMatch(name, m_matchName); } return true; } }
/** * Convert singular name to plural form. * * @param name base name * @return plural name */ public String pluralize(String name) { return NameUtilities.pluralize(name); }
/** * Derive name for item in a collection. If the supplied collection name ends in a recognized plural form the * derived item name is the singular version of the collection name. Otherwise, it is the converted name of the * collection item class, or just "item" if the class is unknown. TODO: internationalization? * * @param cname collection name (<code>null</code> if none) * @param type item type (<code>null</code> if unknown) * @param code conversion format style code * @return item name */ public static String deriveItemName(String cname, String type, int code) { if (cname != null) { String name = NameUtilities.depluralize(cname); if (!name.equals(cname)) { return name; } } if (type != null && !"java.lang.Object".equals(type)) { return convertName(type.substring(type.lastIndexOf('.') + 1), code); } else { return "item"; } }
/** * Check for file name match. * * @param dir * @param name * @return match flag */ public boolean accept(File dir, String name) { boolean match = NameUtilities.isPatternMatch(name, m_pattern); if (match) { s_logger.debug(" matched file name '" + name + '\''); } return match; } }
replace("$0", descript, buff); replace("$1", vardecl.getName().getIdentifier(), buff); replace("$2", NameUtilities.depluralize(NameUtils.toNameWord(basename)), buff); replace("$3", holder.getTypeName(type), buff); String cast = field.getType().isParameterizedType() ? "" : ("(" + type + ")");
match = false; for (int i = 0; i < m_names.length; i++) { if (NameUtilities.isPatternMatch(name, m_names[i])) { match = true; break; if (NameUtilities.isPatternMatch(ns, m_namespaces[i])) { match = true; break;