本文整理汇总了Java中org.apache.commons.lang.WordUtils.capitalizeFully方法的典型用法代码示例。如果您正苦于以下问题:Java WordUtils.capitalizeFully方法的具体用法?Java WordUtils.capitalizeFully怎么用?Java WordUtils.capitalizeFully使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang.WordUtils
的用法示例。
在下文中一共展示了WordUtils.capitalizeFully方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPlayerChat
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOW)
public void onPlayerChat(AsyncPlayerChatEvent e) {
PAUser u = PAServer.getUser(e.getPlayer());
//AdminChat
if (PAServer.getAdminChatMode().contains(u)) {
Utils.sendAdminMsg(u.getName(), e.getMessage());
e.setCancelled(true);
}
//Format
String name = u.getDisplayName().equalsIgnoreCase("") ? u.getName() : u.getDisplayName();
String tag = "[&" + PACmd.Grupo.groupColor(u.getUserData().getGrupo()) + WordUtils.capitalizeFully(u.getUserData().getGrupo().toString().toLowerCase()) + "&r] &" + PACmd.Grupo.groupColor(u.getUserData().getGrupo()) + name + "&r: ";
if (u.isOnRank(PACmd.Grupo.ORIGIN)) e.setMessage(Utils.colorize(e.getMessage()));
e.setFormat(Utils.colorize(tag) + e.getMessage().replace("%", ""));
}
示例2: handleGroup
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
private void handleGroup(YamlConfiguration config, String line) {
String[] lineContents = line.replace("=", "").split(" ");
String[] permissionSplit = lineContents[0].split("\\.");
String group = WordUtils.capitalizeFully(permissionSplit[permissionSplit.length - 1]);
String permission = lineContents[0];
String type = lineContents[1];
String value = line.substring(line.indexOf("\"") + 1);
value = value.substring(0, value.indexOf("\""));
config.set("Groups." + group + ".Permission", permission);
config.set("Groups." + group + ".SortPriority", -1);
if (type.equals("prefix")) {
config.set("Groups." + group + ".Prefix", value);
} else {
config.set("Groups." + group + ".Suffix", value);
}
}
示例3: publishValue
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
/**
* Publishes the item with the value.
*/
private void publishValue(String itemName, Object value, WeatherBindingConfig bindingConfig) {
if (value == null) {
context.getEventPublisher().postUpdate(itemName, UnDefType.UNDEF);
} else if (value instanceof Calendar) {
Calendar calendar = (Calendar) value;
context.getEventPublisher().postUpdate(itemName, new DateTimeType(calendar));
} else if (value instanceof Number) {
context.getEventPublisher().postUpdate(itemName, new DecimalType(round(value.toString(), bindingConfig)));
} else if (value instanceof String || value instanceof Enum) {
if (value instanceof Enum) {
String enumValue = WordUtils.capitalizeFully(StringUtils.replace(value.toString(), "_", " "));
context.getEventPublisher().postUpdate(itemName, new StringType(enumValue));
} else {
context.getEventPublisher().postUpdate(itemName, new StringType(value.toString()));
}
} else {
logger.warn("Unsupported value type {}", value.getClass().getSimpleName());
}
}
示例4: setStyle
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
/**
* @param style the style to set
* Checks DB for Styles when called.
*/
public void setStyle(String style) {
if(style==null) //end execution if null
throw new IllegalArgumentException("Null Value given for Brand");
if(!style.isEmpty()){//do operation if not empty
Style obj = findService.findStyle(WordUtils.capitalizeFully(style.trim()));//we need to find if this Brand exists
styleFound = obj!=null;
if(styleFound){//check if Brand exists
//MOVED TO CREATE skuId.setIdStyle(obj.getIdStyle());//if exists set in skuInfo
sku.setStyle(obj);//if exists set in SKU
}else{//doesn't exist
obj = new Style(WordUtils.capitalizeFully(style.trim())); //Initialize new Brand
//createService.createStyle(obj); //Push to DB the new Brand
//MOVED TO CREATE //skuId.setIdStyle(obj.getIdStyle());//set in skuInfo
sku.setStyle(obj);//set in SKU
}
}
}
示例5: setColorMap
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
/**
* @param colorMap the colorMap to set
*/
public void setColorMap(String colorMap, String color) {
//we need to find if this ColorMap exists
colorMap = WordUtils.capitalizeFully(colorMap);
if(colorMap==null)
throw new IllegalArgumentException("Null Value for ColorMap String");
if(!colorMap.isEmpty()){//don't need to check for color, MySql Default is '1'
ColorMap obj = findService.findColorMap(colorMap);
Color objC = findService.findColor(color);
colorFound = obj!=null;
//JOptionPane.showMessageDialog(null, "Found all my items");
if(colorFound){
obj.setColor(objC);
shoe.setColorMap(obj);
}else{//we have to use the createService here
obj = new ColorMap(objC,colorMap.trim());
//createService.createColorMap(obj);
shoe.setColorMap(obj);
}
}
}
示例6: setProductGroup
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
/**
* @param productGroup the productGroup to set
*/
public void setProductGroup(String productGroup) {
if(productGroup==null)
throw new IllegalArgumentException("Null Value for productGroup String");
if(!productGroup.isEmpty()){//don't need to check for color, MySql Default is '1'
Category obj = findService.findCategory(productGroup);
categoryFound = obj!=null;
if(categoryFound){
System.out.println(obj.getCategory().toString());
sku.setCategory(obj);
}else{//we have to use the createService here
obj = new Category(WordUtils.capitalizeFully(productGroup.trim()));
//createService.createCategory(obj);//should be moved to create class
sku.setCategory(obj);
}
}
}
示例7: transformFieldValue
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
@Around("set(@org.openregistry.core.domain.normalization.NameSuffix * *)")
public Object transformFieldValue(final ProceedingJoinPoint joinPoint) throws Throwable {
final String value = (String) joinPoint.getArgs()[0];
if (isDisabled() || value == null || value.isEmpty()) {
return joinPoint.proceed();
}
final String overrideValue = getCustomMapping().get(value);
if (overrideValue != null) {
return joinPoint.proceed(new Object[] {overrideValue});
}
final String casifyValue;
if (value.matches("^[IiVv]+$")) { //TODO Generalize II - VIII
casifyValue = value.toUpperCase();
} else {
casifyValue = WordUtils.capitalizeFully(value);
}
return joinPoint.proceed(new Object[] {casifyValue});
}
示例8: publishValue
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
/**
* Publishes the item with the value.
*/
private void publishValue(String itemName, Object value, WeatherBindingConfig bindingConfig) {
if (value == null) {
context.getEventPublisher().postUpdate(itemName, UnDefType.UNDEF);
} else if (value instanceof Calendar) {
Calendar calendar = (Calendar) value;
context.getEventPublisher().postUpdate(itemName, new DateTimeType(calendar));
} else if (value instanceof Number) {
context.getEventPublisher().postUpdate(itemName, new DecimalType(round(value.toString(), bindingConfig)));
} else if (value instanceof String || value instanceof Enum) {
if (value instanceof Enum) {
String enumValue = WordUtils.capitalizeFully(StringUtils.replace(value.toString(), "_", " "));
context.getEventPublisher().postUpdate(itemName, new StringType(enumValue));
} else {
context.getEventPublisher().postUpdate(itemName, new StringType(value.toString()));
}
} else {
logger.warn("Unsupported value type {}", value.getClass().getSimpleName());
}
}
示例9: deriveExpressibleName
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
public static String deriveExpressibleName(String colName, String tableName, boolean dePluralize) {
tableName = CommonUtils.removeQuotes(tableName).trim();
if(dePluralize) {
String tn = tableName.toLowerCase();
if(tn.endsWith("ves")) {
tableName = tn.replaceAll("ves$", "f");
}
else if(tn.endsWith("ies")) {
tableName = tn.replaceAll("ies$", "y");
}
else if(tn.endsWith("s")) {
tableName = tn.replaceAll("s$", "");
}
}
colName = CommonUtils.removeQuotes(colName).trim();
if(colName.toLowerCase().equalsIgnoreCase("id")) {
colName = tableName+ "_"+colName;
}
if(colName.contains("_")){
return WordUtils.capitalizeFully(colName.replaceAll("_", " "));
}else{
colName = colName.replaceAll(
String.format("%s|%s|%s",
"(?<=[A-Z])(?=[A-Z][a-z])",
"(?<=[^A-Z])(?=[A-Z])",
"(?<=[A-Za-z])(?=[^A-Za-z])"
),
" "
);
if(!colName.contains(" ")){
colName = WordUtils.capitalizeFully(colName);
}
return colName;
}
}
示例10: populateForCommon
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
protected String populateForCommon(String input, ThreePid recipient) {
String domainPretty = WordUtils.capitalizeFully(mxCfg.getDomain());
return input
.replace("%DOMAIN%", mxCfg.getDomain())
.replace("%DOMAIN_PRETTY%", domainPretty)
.replace("%RECIPIENT_MEDIUM%", recipient.getMedium())
.replace("%RECIPIENT_ADDRESS%", recipient.getAddress());
}
示例11: evaluate
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
@Override
public Object evaluate(DeferredObject[] arguments) throws HiveException {
String val = getStringValue(arguments, 0, converters);
if (val == null) {
return null;
}
String valCap = WordUtils.capitalizeFully(val);
output.set(valCap);
return output;
}
示例12: getFakeInventory
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
public Inventory getFakeInventory(Player player, String locale) {
Inventory inventory = Bukkit.createInventory(null, 45, player.getDisplayName().length() > 32 ? TeamManager.getTeamByPlayer(player).getColor() + player.getName() : player.getDisplayName());
inventory.setItem(0, player.getInventory().getHelmet());
inventory.setItem(1, player.getInventory().getChestplate());
inventory.setItem(2, player.getInventory().getLeggings());
inventory.setItem(3, player.getInventory().getBoots());
inventory.setItem(4, player.getInventory().getItemInOffHand());
ItemStack potion;
if (player.getActivePotionEffects().size() > 0){
ArrayList<String> effects = new ArrayList<>();
for (PotionEffect effect : player.getActivePotionEffects()) {
String effectName = WordUtils.capitalizeFully(effect.getType().getName().toLowerCase().replaceAll("_", " "));
effects.add(ChatColor.YELLOW + effectName + " " + (effect.getAmplifier() + 1));
}
potion = Items.createItem(Material.POTION, 1, (short) 0, ChatUtil.HIGHLIGHT + "" + ChatColor.ITALIC + new LocalizedChatMessage(ChatConstant.UI_POTION_EFFECTS).getMessage(locale), effects);
} else {
potion = Items.createItem(Material.GLASS_BOTTLE, 1, (short) 0, ChatUtil.HIGHLIGHT + "" + ChatColor.ITALIC + new LocalizedChatMessage(ChatConstant.UI_POTION_EFFECTS).getMessage(locale), new ArrayList<>(Collections.singletonList(ChatColor.YELLOW + new LocalizedChatMessage(ChatConstant.UI_NO_POTION_EFFECTS).getMessage(locale))));
}
inventory.setItem(6, potion);
ItemStack food = Items.createItem(Material.COOKED_BEEF, player.getFoodLevel(), (short) 0, ChatUtil.HIGHLIGHT + "" + ChatColor.ITALIC + new LocalizedChatMessage(ChatConstant.UI_HUNGER_LEVEL).getMessage(locale));
inventory.setItem(7, food);
ItemStack health = Items.createItem(Material.REDSTONE, (int) Math.ceil(player.getHealth()), (short) 0, ChatUtil.HIGHLIGHT + "" + ChatColor.ITALIC + new LocalizedChatMessage(ChatConstant.UI_HEALTH_LEVEL).getMessage(locale));
inventory.setItem(8, health);
for (int i = 36; i <= 44; i++) {
inventory.setItem(i, player.getInventory().getItem(i - 36));
}
for (int i = 9; i <= 35; i++) {
inventory.setItem(i, player.getInventory().getItem(i));
}
return inventory;
}
示例13: getLabel
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
public static String getLabel(String feature_tag) {
if (mTagToLabelMap == null) {
initMap();
}
if (mTagToLabelMap.containsKey(feature_tag)) {
return mTagToLabelMap.get(feature_tag);
} else {
return WordUtils.capitalizeFully(feature_tag.replace("-", " "));
}
}
示例14: parseFieldName
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
@Override
public String parseFieldName(String name) {
String capitalized = name;
if (name.contains(" ")) {
capitalized = WordUtils.capitalizeFully(name);
}
if (name.contains("_"))
capitalized = WordUtils.capitalizeFully(capitalized, new char[]{'_'});
else
capitalized = WordUtils.capitalizeFully(capitalized);
String javaConvention = DtoHelper.firstetterToLowerCase(capitalized);
String removedSpace = javaConvention.replaceAll(" ", "");
return removedSpace.replaceAll("_", "");
}
示例15: addStringMappings
import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
private void addStringMappings(String name, String value) {
String capitalized = WordUtils.capitalizeFully(value);
String upperCamel = StringUtils.deleteWhitespace(capitalized);
String lowerCamel = StringUtils.uncapitalize(upperCamel);
replacementStrings.put(name + LOWER_CAMEL_CASE_SUFFIX, lowerCamel);
replacementStrings.put(name + UPPER_CAMEL_CASE_SUFFIX, upperCamel);
}