Java Code Examples for org.apache.commons.lang3.StringUtils.uncapitalize()

The following are Jave code examples for showing how to use uncapitalize() of the org.apache.commons.lang3.StringUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: easyweb   File: ObjectUtils.java   View Source Code Vote up 6 votes
/**
 * 注解到对象复制,只复制能匹配上的方法。
 * @param annotation
 * @param object
 */
public static void annotationToObject(Object annotation, Object object){
	if (annotation != null){
		Class<?> annotationClass = annotation.getClass();
		if (null == object) {
			return;
		}
		Class<?> objectClass = object.getClass();
		for (Method m : objectClass.getMethods()){
			if (StringUtils.startsWith(m.getName(), "set")){
				try {
					String s = StringUtils.uncapitalize(StringUtils.substring(m.getName(), 3));
					Object obj = annotationClass.getMethod(s).invoke(annotation);
					if (obj != null && !"".equals(obj.toString())){
						m.invoke(object, obj);
					}
				} catch (Exception e) {
					// 忽略所有设置失败方法
				}
			}
		}
	}
}
 
Example 2
Project: hashsdn-controller   File: DatastoreContextIntrospector.java   View Source Code Vote up 5 votes
private static String convertToCamelCase(final String inString) {
    String str = inString.trim();
    if (StringUtils.contains(str, '-') || StringUtils.contains(str, ' ')) {
        str = inString.replace('-', ' ');
        str = WordUtils.capitalizeFully(str);
        str = StringUtils.deleteWhitespace(str);
    }

    return StringUtils.uncapitalize(str);
}
 
Example 3
Project: sponge   File: SpongeUtils.java   View Source Code Vote up 4 votes
public static String createControlEventName(Class<? extends ControlEvent> controlEventClass) {
    return EngineConstants.CONTROL_EVENT_PREFIX + StringUtils.uncapitalize(controlEventClass.getSimpleName());
}
 
Example 4
Project: satisfy   File: SatisfyBaseStepListener.java   View Source Code Vote up 4 votes
private void addToFluentStepName(String stepName) {
    String updatedStepName = getCurrentStep().getDescription() + " " +
            StringUtils.uncapitalize(stepName);
    getCurrentStep().setDescription(updatedStepName);
}
 
Example 5
Project: vscrawler   File: Uncapitalize.java   View Source Code Vote up 4 votes
@Override
protected String handleSingleStr(String input) {
    return StringUtils.uncapitalize(input);
}
 
Example 6
Project: rpc   File: RpcUtil.java   View Source Code Vote up 4 votes
public static String getDefaultBeanName(Class<?> classType) {
    return StringUtils.uncapitalize(classType.getSimpleName());
}
 
Example 7
Project: rpc   File: RpcUtil.java   View Source Code Vote up 4 votes
public static String getBeanId(Element element, Class<?> classType) {
    String id = element.getAttribute("id");
    return Strings.isNullOrEmpty(id) ? StringUtils.uncapitalize(classType.getSimpleName()) : id;
}
 
Example 8
Project: uroborosql   File: StringFunction.java   View Source Code Vote up 2 votes
/**
 * 文字列の先頭を小文字にする
 *
 * <pre>
 * StringUtils.uncapitalize(null)  = null
 * StringUtils.uncapitalize("")    = ""
 * StringUtils.uncapitalize("Cat") = "cat"
 * StringUtils.uncapitalize("CAT") = "cAT"
 * </pre>
 *
 * @param str 文字列
 * @return 先頭を小文字にした文字列
 * @see StringUtils#uncapitalize(String)
 * @see #capitalize(String)
 */
public String uncapitalize(final String str) {
	return StringUtils.uncapitalize(str);
}
 
Example 9
Project: yadaframework   File: YadaUtil.java   View Source Code Vote up 2 votes
/**
 * Get any bean defined in the Spring ApplicationContext
 * @param beanClass
 * @return
 */
public static Object getBean(Class beanClass, Object ... args) {
	String beanName = StringUtils.uncapitalize(beanClass.getSimpleName());
	return getBean(beanName, args);
}