当前位置: 首页>>代码示例>>Java>>正文


Java WordUtils.capitalizeFully方法代码示例

本文整理汇总了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("%", ""));
}
 
开发者ID:cadox8,项目名称:PA,代码行数:18,代码来源:PlayerListener.java

示例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);
    }
}
 
开发者ID:sgtcaze,项目名称:NametagEdit,代码行数:17,代码来源:Converter.java

示例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());
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:23,代码来源:WeatherPublisher.java

示例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
		}
	}
}
 
开发者ID:VDuda,项目名称:SyncRunner-Pub,代码行数:24,代码来源:Item.java

示例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);
		}
	}
}
 
开发者ID:VDuda,项目名称:SyncRunner-Pub,代码行数:25,代码来源:Item.java

示例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);
		}
	}
}
 
开发者ID:VDuda,项目名称:SyncRunner-Pub,代码行数:21,代码来源:Item.java

示例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});
   }
 
开发者ID:Jasig,项目名称:openregistry,代码行数:24,代码来源:NameSuffixAspect.java

示例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());
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:23,代码来源:WeatherPublisher.java

示例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;
	}		   
}
 
开发者ID:ajoabraham,项目名称:hue,代码行数:40,代码来源:PersistUtils.java

示例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());
}
 
开发者ID:kamax-io,项目名称:mxisd,代码行数:10,代码来源:PlaceholderNotificationGenerator.java

示例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;
}
 
开发者ID:myui,项目名称:hive-udf-backports,代码行数:12,代码来源:GenericUDFInitCap.java

示例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;
}
 
开发者ID:Minehut,项目名称:GamePlate,代码行数:33,代码来源:InventoryViewModule.java

示例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("-", " "));
     }
}
 
开发者ID:ldsddn,项目名称:wordpress_app_android,代码行数:11,代码来源:ThemeUtils.java

示例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("_", "");
}
 
开发者ID:nvinayshetty,项目名称:DTOnator,代码行数:16,代码来源:CamelCase.java

示例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);
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:8,代码来源:ProjectTemplateSection.java


注:本文中的org.apache.commons.lang.WordUtils.capitalizeFully方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。