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


Java WordUtils.capitalize方法代码示例

本文整理汇总了Java中org.apache.commons.lang.WordUtils.capitalize方法的典型用法代码示例。如果您正苦于以下问题:Java WordUtils.capitalize方法的具体用法?Java WordUtils.capitalize怎么用?Java WordUtils.capitalize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.lang.WordUtils的用法示例。


在下文中一共展示了WordUtils.capitalize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: collect

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
@Override
public List<Method> collect(@NotNull Method psiElement) {
    List<Method> results = new ArrayList<>();

    PhpClass methodClass = psiElement.getContainingClass();
    if (methodClass == null) {
        return results;
    }

    List<PhpClass> pluginsList = pluginClassCache.getPluginsForClass(methodClass);
    List<Method> pluginMethods = pluginClassCache.getPluginMethods(pluginsList);

    String classMethodName = WordUtils.capitalize(psiElement.getName());
    for (Method pluginMethod: pluginMethods) {
        if (isPluginMethodName(pluginMethod.getName(), classMethodName)) {
            results.add(pluginMethod);
        }
    }
    return results;
}
 
开发者ID:magento,项目名称:magento2-phpstorm-plugin,代码行数:21,代码来源:PluginLineMarkerProvider.java

示例2: ContextInstance

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
public ContextInstance(String line, boolean noPosFlag) {
	this.line = line;
	String[] tokens = line.split("\t");
	this.targetInd = Integer.parseInt(tokens[TARGET_INDEX]);
	this.words = tokens[3].split(" ");
	this.target = this.words[this.targetInd];
	this.fullTargetKey = tokens[0];
	this.pos = this.fullTargetKey.split(".")[this.fullTargetKey.split(".").length - 1];
	String[] tmp = this.fullTargetKey.split(".");
	this.targetKey = String.join(".", Arrays.asList(tmp[0], tmp[1])); // remove suffix in cases of bar.n.v
	this.targetLemma = this.fullTargetKey.split(".")[0];
	this.targetId = Integer.parseInt(tokens[1]);
	if (validPOS.contains(this.pos)) this.pos = WordUtils.capitalize(this.pos);
	if (noPosFlag) this.targetPos = String.join(".", Arrays.asList(this.target, "*"));
	else this.targetPos = String.join(".", Arrays.asList(this.target, this.pos));
}
 
开发者ID:IsaacChanghau,项目名称:Word2VecfJava,代码行数:17,代码来源:ContextInstance.java

示例3: getPojoClassName

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
protected String getPojoClassName(String prefix, String suffix, String tableName) {
    String className = tableName;
    if (null != prefix && !prefix.isEmpty() && className.indexOf(prefix) == 0) {
        className = className.replaceFirst(prefix, "");
    }
    if (null != suffix && !suffix.isEmpty()) {
        className = className + WordUtils.capitalize(suffix);
    }

    StringBuilder result = new StringBuilder();
    for (String str : StringUtils.split(className, "_")) {
        result.append(WordUtils.capitalize(str));
    }

    return WordUtils.capitalize(result.toString());
}
 
开发者ID:ctripcorp,项目名称:dal,代码行数:17,代码来源:AbstractJavaDataPreparer.java

示例4: getPojoClassName

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
protected String getPojoClassName(String prefix, String suffix, String table) {
    String className = table;
    if (null != prefix && !prefix.isEmpty() && className.indexOf(prefix) == 0) {
        className = className.replaceFirst(prefix, "");
    }
    if (null != suffix && !suffix.isEmpty()) {
        className = className + WordUtils.capitalize(suffix);
    }

    StringBuilder result = new StringBuilder();
    for (String str : StringUtils.split(className, "_")) {
        result.append(WordUtils.capitalize(str));
    }

    return WordUtils.capitalize(result.toString());
}
 
开发者ID:ctripcorp,项目名称:dal,代码行数:17,代码来源:AbstractCSharpDataPreparer.java

示例5: applyConversion

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
/**
 * Apply a case conversion to an input string
 * @param source
 * @return
 */
private String applyConversion(String source) {
	
	String result = source;
	
	// Find global property 
	if ("global".equalsIgnoreCase(caseConversion)) {
		AdministrationService adminService = Context.getAdministrationService();
		caseConversion = adminService.getGlobalProperty(OpenmrsConstants.GP_DASHBOARD_METADATA_CASE_CONVERSION);
	}
	
	// Apply conversion
	if ("lowercase".equalsIgnoreCase(caseConversion)) {
		result = StringUtils.lowerCase(result);
	} else if ("uppercase".equalsIgnoreCase(caseConversion)) {
		result = StringUtils.upperCase(result);
	} else if ("capitalize".equalsIgnoreCase(caseConversion)) {
		result = WordUtils.capitalize(StringUtils.lowerCase(result));
	}
	return result;
}
 
开发者ID:openmrs,项目名称:openmrs-module-legacyui,代码行数:26,代码来源:FormatTag.java

示例6: getCounty

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
/**
 * Extract the county from the Origin field
 * 
 * @return
 */
public String getCounty()
{
	String origin = this.getOrigin();
	String[] parts = origin.split("__");
	if(parts.length==4)
	{
		
		 String county = parts[1].trim();
		 return WordUtils.capitalize(county.toLowerCase().replace("--", " - "));	
		
	}
	
	log.error("Unable to extract County information from origin field from '"+this.getCatalogCode()+"'");

	return null;
	
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:23,代码来源:RediscoveryExportEx.java

示例7: simpleManipulations

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
private String simpleManipulations(String value, String manipulation) {
    String result;
    switch (manipulation) {
        case "toupper":
            result = value.toUpperCase();
            break;
        case "tolower":
            result = value.toLowerCase();
            break;
        case "capitalize":
            result = WordUtils.capitalize(value);
            break;
        case "urlencode":
            try {
                result = URLEncoder.encode(value, "UTF-8");
            } catch (UnsupportedEncodingException e) {
                throw new MotechException("URLEncode manipulator error.", e);
            }
            break;
        default:
            throw new MotechException("task.warning.manipulation");
    }
    return result;
}
 
开发者ID:motech,项目名称:motech,代码行数:25,代码来源:KeyEvaluator.java

示例8: translateGenre

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
/**
 * Translate Genre from config file.
 */
private String translateGenre(String genre){
	if (settingsService == null) {
		settingsService = new SettingsService();
	}
	
	if (settingsService.isOrganizeByGenreMap()) {    	
    	if (hmap.size() < 1) { readConfig(); }
        String mappedGenre = hmap.get(genre); 
        if (mappedGenre != null) {
            LOG.debug("## replaced Genre: " + genre + " -> " + mappedGenre);
            return WordUtils.capitalize(mappedGenre);
        }
    	return WordUtils.capitalize(genre);
	} else {
		return genre;
	}
}
 
开发者ID:MadMarty,项目名称:madsonic-server-5.1,代码行数:21,代码来源:JaudiotaggerParser.java

示例9: listStats

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
private void listStats(Player player, StatType[] stats) {
    String GRAY = ChatColor.GRAY.toString();
    String DARK_AQUA = ChatColor.DARK_AQUA.toString();
    String AQUA = ChatColor.AQUA.toString();

    player.sendMessage(GRAY + "=========[ " + DARK_AQUA + _("INFO_COMMAND_STATS") + GRAY
            + " ]=========");

    for (StatType stat : stats) {
        if (stat == null)
            continue;
        String name = WordUtils.capitalize(stat.name().toLowerCase()
                .replace('_', ' '));

        player.sendMessage(DARK_AQUA + name + ": " + AQUA
                + manager.getStat(stat, player));
    }
    player.sendMessage(GRAY + "=========================");
}
 
开发者ID:cancabron,项目名称:Annihilation,代码行数:20,代码来源:StatsCommand.java

示例10: getName

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
public String getName() {
    String name;
    ItemMeta meta = item.getItemMeta();
    if (meta.hasDisplayName()) {
        name = meta.getDisplayName();
    } else {
        name = item.getType().name();
        name = name.replace("_", " ").toLowerCase();
        name = WordUtils.capitalize(name);
        name += ChatColor.WHITE; // In case it's a wand
    }
    if (item.getAmount() > 1)
        name = item.getAmount() + " " + name;

    return name;
}
 
开发者ID:cancabron,项目名称:Annihilation,代码行数:17,代码来源:Shop.java

示例11: setPersonFields

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
@Override
protected void setPersonFields() {
    final Person person = getDocumentRequest().getPerson();
    addParameter("name", StringFormatter.prettyPrint(person.getName()));
    addParameter("nameOfFather", StringFormatter.prettyPrint(person.getNameOfFather()));
    addParameter("nameOfMother", StringFormatter.prettyPrint(person.getNameOfMother()));

    String country;
    String countryUpperCase;
    if (person.getCountry() != null) {
        countryUpperCase = person.getCountry().getCountryNationality().getContent(getLanguage()).toLowerCase();
        country = WordUtils.capitalize(countryUpperCase);
    } else {
        throw new DomainException("error.personWithoutParishOfBirth");
    }

    String nationality = BundleUtil.getString(Bundle.ACADEMIC, getLocale(), "diploma.nationality");
    addParameter("birthLocale", MessageFormat.format(nationality, country));
}
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:20,代码来源:Diploma.java

示例12: addPersonParameters

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
private void addPersonParameters() {
    final Person person = getDocumentRequest().getPerson();
    addParameter("name", StringFormatter.prettyPrint(person.getName()));
    addParameter("nameOfFather", StringFormatter.prettyPrint(person.getNameOfFather()));
    addParameter("nameOfMother", StringFormatter.prettyPrint(person.getNameOfMother()));

    String country;
    String countryUpperCase;
    if (person.getCountry() != null) {
        countryUpperCase = person.getCountry().getCountryNationality().getContent(getLanguage()).toLowerCase();
        country = WordUtils.capitalize(countryUpperCase);
    } else {
        throw new DomainException("error.personWithoutParishOfBirth");
    }

    String nationality = BundleUtil.getString(Bundle.ACADEMIC, getLocale(), "diploma.nationality");
    addParameter("birthLocale", MessageFormat.format(nationality, country));

}
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:20,代码来源:PhdDiploma.java

示例13: process

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
@Override
public String process( String input, Object rawLine )
{
	if( input == null )
		return null;

	input = StringUtils.trim( input ).replaceAll( "[ ]{2,}", " " ).toLowerCase();

	input = preProcess( input ).replaceAll( "[ ]{2,}", " " );

	StringBuilder stringBuilder = new StringBuilder();
	String[] tokens = input.split( "[ ]" );
	for( String token : tokens )
	{
		stringBuilder.append( processToken( token ) );
		stringBuilder.append( " " );
	}

	return WordUtils.capitalize( StringUtils.trim( stringBuilder.toString() ).replaceAll( "[ ]{2,}", " " ) );
}
 
开发者ID:jkgohlke,项目名称:flatfile,代码行数:21,代码来源:AddressProcessor.java

示例14: getStdMethodName

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
static public String getStdMethodName(String str) {
    String ret = "";
    if (str != null) {
        String[] temp = str.split("_");
        for (int i = 0; i < temp.length; i++) {
            ret += WordUtils.capitalize(temp[i]);
        }
    }
    return ret;
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:11,代码来源:FrmXml2VTData.java

示例15: service

import org.apache.commons.lang.WordUtils; //导入方法依赖的package包/类
@Override
protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {

    req.setCharacterEncoding("Shift_JIS");
    res.setContentType("text/html; charset=UTF-8");
    try {
        String string = req.getParameter("string");
        Locale locale = req.getLocale();

        StringBuilder bodyHtml = new StringBuilder();

        bodyHtml.append("<form action=\"mojibake\" method=\"post\">");
        bodyHtml.append(getMsg("description.capitalize.string", locale));
        bodyHtml.append("<br><br>");
        bodyHtml.append(getMsg("label.string", locale) + ": ");
        bodyHtml.append("<input type=\"text\" name=\"string\" size=\"100\" maxlength=\"100\">");
        bodyHtml.append("<br><br>");
        bodyHtml.append("<input type=\"submit\" value=\"" + getMsg("label.submit", locale) + "\">");
        bodyHtml.append("<br><br>");

        if (string != null && !"".equals(string)) {
            // Capitalize the given string
            String capitalizeName = WordUtils.capitalize(string);
            bodyHtml.append(getMsg("label.capitalized.string", locale) + " : " + encodeForHTML(capitalizeName));
        } else {
            bodyHtml.append(getMsg("msg.enter.string", locale));
        }
        bodyHtml.append("<br><br>");
        bodyHtml.append(getInfoMsg("msg.note.mojibake", locale));
        bodyHtml.append("</form>");

        responseToClient(req, res, getMsg("title.mojibake.page", locale), bodyHtml.toString());

    } catch (Exception e) {
        log.error("Exception occurs: ", e);
    }
}
 
开发者ID:k-tamura,项目名称:easybuggy,代码行数:38,代码来源:MojibakeServlet.java


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