當前位置: 首頁>>代碼示例>>Java>>正文


Java WordUtils.uncapitalize方法代碼示例

本文整理匯總了Java中org.apache.commons.lang.WordUtils.uncapitalize方法的典型用法代碼示例。如果您正苦於以下問題:Java WordUtils.uncapitalize方法的具體用法?Java WordUtils.uncapitalize怎麽用?Java WordUtils.uncapitalize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.lang.WordUtils的用法示例。


在下文中一共展示了WordUtils.uncapitalize方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getBean

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
/**
 * Attempts to find a Spring bean based of the specified class. This method first attempts to load a bean
 * following the default Spring auto-naming conventions (de-capitalizing class simple name). In case the bean with 
 * this name can't be found, the method returns the first available bean of this class.
 * <p/>
 * Such logic is required in order to enable this method to lookup components from legacy contexts. "Older" beans seems to 
 * have identifiers hard-coded in the bean definition file, while "newer" bean identifiers are auto-generated by Spring based on the
 * annotations.
 * 
 * @param clazz
 * 		Class of the bean to be looked up
 * @return
 * 		Returns the bean instance
 * @throws NoSuchBeanDefinitionException if there is no bean definition with the specified name
 */
@SuppressWarnings("unchecked")
public static <T> T getBean(Class<?> clazz) {
	// legacy code - I wonder if it's necessary since we are looking up a bean based directly on the class name anyways
	// but to keep legacy logic working properly attempt to locate component based on the Spring conventions 
	String className = WordUtils.uncapitalize(clazz.getSimpleName());
	if (beanFactory.containsBean(className))
		return (T) beanFactory.getBean(className);
	
	if (ListableBeanFactory.class.isAssignableFrom(beanFactory.getClass())) {
		ListableBeanFactory listableBeanFactory = (ListableBeanFactory) beanFactory;
		String[] beanNames = listableBeanFactory.getBeanNamesForType(clazz);
		if (beanNames.length > 0)
			return (T) listableBeanFactory.getBean(beanNames[0]);
	}
	throw new NoSuchBeanDefinitionException(clazz);
}
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:32,代碼來源:SpringUtils.java

示例2: getUncapitalizedName

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
public String getUncapitalizedName() {
    String tempName = name.replace("@", "");
    // if (tempName.contains("_")) {
    // tempName = WordUtils.capitalizeFully(tempName.replace('_', ' ')).replace(" ", "");
    // }
    return WordUtils.uncapitalize(tempName);
}
 
開發者ID:ctripcorp,項目名稱:dal,代碼行數:8,代碼來源:JavaParameterHost.java

示例3: getCamelCaseUncapitalizedName

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
public String getCamelCaseUncapitalizedName() {
    String temp = name.replace("@", "");
    if (temp.contains("_")) {
        temp = WordUtils.capitalizeFully(temp.replace('_', ' ')).replace(" ", "");
    }
    return WordUtils.uncapitalize(temp);
}
 
開發者ID:ctripcorp,項目名稱:dal,代碼行數:8,代碼來源:JavaParameterHost.java

示例4: getSuggestedNames

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
@Nullable
@Override
public SuggestedNameInfo getSuggestedNames(PsiElement psiElement, PsiElement psiElement1, Set<String> set) {

    if(!(psiElement instanceof Parameter)) {
        return null;
    }

    List<String> filter = ContainerUtil.filter(PhpNameSuggestionUtil.variableNameByType((Parameter) psiElement, psiElement.getProject(), false), s -> !StringUtil.containsChar(s, '\\'));

    if(filter.size() == 0) {
        return null;
    }

    for (String item : filter) {

        for(String end: TRIM_STRINGS) {

            // ending
            if(item.toLowerCase().endsWith(end)) {
                item = item.substring(0, item.length() - end.length());
            }

            // remove starting
            if(item.toLowerCase().startsWith(end)) {
                item = WordUtils.uncapitalize(item.substring(end.length()));
            }
        }

        if(StringUtils.isNotBlank(item)) {
            set.add(item);
        }
    }

    return null;
}
 
開發者ID:Haehnchen,項目名稱:idea-php-toolbox,代碼行數:37,代碼來源:TypeHintSuggestionProvider.java

示例5: createMapClass

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
private static void createMapClass(Retrieve retrieve, Map<String, Integer> columns, String packageName, File destinationDir) throws JClassAlreadyExistsException,
																															MapperEngineCodeGeneratorException,
																															IOException {
	JCodeModel codeModel = new JCodeModel();
	JDefinedClass mapClass = codeModel._class(String.format("%s.%sMap", packageName, retrieve.getId()));
	mapClass.javadoc().append("Auto generated class. Do not modify!");

	// Constructor
	JMethod constructor = mapClass.constructor(JMod.PROTECTED);
	constructor.param(codeModel.ref(Map.class).narrow(String.class, Object.class), "data");

	for (String column : columns.keySet()) {
		String varName = WordUtils.uncapitalize(column);
		Class<?> type = null;
		switch (columns.get(column)) {
		case Types.INTEGER:
			type = Integer.class;
			break;
		case Types.VARCHAR:
			type = String.class;
			break;
		case Types.DECIMAL:
			type = BigDecimal.class;
			break;
		default:
			throw new MapperEngineCodeGeneratorException(String.format("Missing Type map for column %s: %d", column, columns.get(column)));
		}

		JFieldVar field = mapClass.field(JMod.PRIVATE | JMod.FINAL, type, varName);

		// Getter
		JMethod getter = mapClass.method(JMod.PUBLIC, type, String.format("get%s", column));
		getter.body()._return(JExpr._this().ref(field));

		constructor.body().assign(JExpr._this().ref(varName), JExpr.cast(codeModel.ref(type), JExpr.ref("data").invoke("get").arg(column)));
	}
	codeModel.build(destinationDir);
}
 
開發者ID:vincenzomazzeo,項目名稱:map-engine,代碼行數:39,代碼來源:MapperEngineCodeGenerator.java

示例6: onRightClick

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
@EventHandler
public void onRightClick(PlayerInteractEvent event) {
	if (event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getState() instanceof Sign) {
		Sign clickedSign = (Sign) event.getClickedBlock().getState();
		if (ChatColor.stripColor(clickedSign.getLine(0)).equalsIgnoreCase("[HorseMount]") && event.getPlayer().hasPermission("horsemount.signs.use")) {
			if (this.mountArmor.get(WordUtils.uncapitalize(clickedSign.getLine(1))) != null) {
				PluginCommand setArmor = getServer().getPluginCommand("setarmor");
				String armorArgs[];
				armorArgs = new String[1];
				armorArgs[0] = WordUtils.uncapitalize(clickedSign.getLine(1));
				setArmor.execute(event.getPlayer(), "setarmor", armorArgs);
			} else {
				String[] lines = clickedSign.getLines();
				int argsCount = 0;
				for (String line : lines) {
					if (!line.equalsIgnoreCase("") && !ChatColor.stripColor(line).equalsIgnoreCase("[HorseMount]")) {
						argsCount++;
					}
				}
				PluginCommand setMount = getServer().getPluginCommand("setmount");
				String[] mountArgs;
				mountArgs = new String[argsCount];
				int count = 0;
				while (count < argsCount) {
					mountArgs[count] = WordUtils.uncapitalize(lines[count+1]);
					count++;
				}
				setMount.execute(event.getPlayer(), "setmount", mountArgs);
			}
		}
	}
}
 
開發者ID:ktross,項目名稱:HorseMount,代碼行數:33,代碼來源:HorseMount.java

示例7: getVariableName

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
public String getVariableName() {
    return WordUtils.uncapitalize(pojoClassName);
}
 
開發者ID:ctripcorp,項目名稱:dal,代碼行數:4,代碼來源:JavaMethodHost.java

示例8: simpleUniqueConstraintError

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
private String simpleUniqueConstraintError(Identifiable<?> entity, String property) {
    return WordUtils.uncapitalize(entity.entityClassName()) + "_" + property + "_already_exists";
}
 
開發者ID:jaxio,項目名稱:javaee-lab,代碼行數:4,代碼來源:JpaUniqueUtil.java

示例9: compositeUniqueConstraintErrorCode

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
private String compositeUniqueConstraintErrorCode(Identifiable<?> entity, UniqueConstraint uniqueConstraint) {
    return WordUtils.uncapitalize(entity.entityClassName()) + "_"
            + (uniqueConstraint.name() == null ? "composite_unique_constraint_error" : uniqueConstraint.name().toLowerCase());
}
 
開發者ID:jaxio,項目名稱:javaee-lab,代碼行數:5,代碼來源:JpaUniqueUtil.java

示例10: getInstance

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
public String getInstance() {
    return WordUtils.uncapitalize(getName());
}
 
開發者ID:feroult,項目名稱:yawp,代碼行數:4,代碼來源:EndpointNaming.java

示例11: getPipeSinkInstance

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
public String getPipeSinkInstance() {
    return WordUtils.uncapitalize(getPipeSinkName());
}
 
開發者ID:feroult,項目名稱:yawp,代碼行數:4,代碼來源:EndpointNaming.java

示例12: toName

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
private static String toName(final FieldKey key) {
    return WordUtils.uncapitalize(WordUtils.capitalizeFully(key.name().replace('_', ' ')).replace(" ", ""));
}
 
開發者ID:edouardhue,項目名稱:comeon,代碼行數:4,代碼來源:AudioReader.java

示例13: uncapitalize

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
public static String uncapitalize(String s) 
{ 
  if (s == null) return s;
  return WordUtils.uncapitalize(s); 
}
 
開發者ID:dr-jts,項目名稱:jeql,代碼行數:6,代碼來源:StringFunction.java

示例14: getWebServiceClassPath

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
/**
 * Return the convention path for both SOAP and REST web service classes. All web
 * service classes are assumed to end with "ServiceSoap" or "ServiceRest". The
 * correspondence is then: class "MyServiceSoap" -> path "my"; class "MyServiceRest"
 * -> path "my".
 *
 * @param serviceClass
 *            SOAP or REST service class
 * @return corresponding web service deployment path
 */
public static String getWebServiceClassPath(final Class<?> serviceClass)
{
	return WordUtils.uncapitalize(serviceClass
			.getSimpleName()
			.replaceAll(SERVICE_SOAP_SUFFIX, EMPTY_STRING)
			.replaceAll(SERVICE_REST_SUFFIX, EMPTY_STRING));
}
 
開發者ID:openfurther,項目名稱:further-open-core,代碼行數:18,代碼來源:WsUtil.java

示例15: AbstractDataSetURLGenerator

import org.apache.commons.lang.WordUtils; //導入方法依賴的package包/類
/**
 * Create the generator
 * 
 * @param typeUrlPart
 *            type part in URL (upper/lower case first char will be done via conversion)
 */
public AbstractDataSetURLGenerator( URLGeneratorBean urlBean, String typeUrlPart, String resourceDir ) {
	this( urlBean, WordUtils.uncapitalize( typeUrlPart ), WordUtils.capitalize( typeUrlPart ), resourceDir );
}
 
開發者ID:PE-INTERNATIONAL,項目名稱:soda4lca,代碼行數:10,代碼來源:AbstractDataSetURLGenerator.java


注:本文中的org.apache.commons.lang.WordUtils.uncapitalize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。