Java Code Examples for org.springframework.util.StringUtils.uncapitalize()

The following are Jave code examples for showing how to use uncapitalize() of the org.springframework.util.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: xm-commons   File: LepServicesRegistrar.java   View Source Code Vote up 5 votes
private static String getBeanName(AnnotationMetadata annotationMetadata, Map<String, Object> attributes) {
    // name & value are aliases
    String beanName = (String) attributes.get("value");
    if (!StringUtils.isEmpty(beanName)) {
        return beanName;
    } else {
        // generate bean name from class name
        String shortName = ClassUtils.getShortName(annotationMetadata.getClassName());
        return StringUtils.uncapitalize(shortName);
    }
}
 
Example 2
Project: xm-ms-entity   File: LepServicesRegistrar.java   View Source Code Vote up 5 votes
private static String getBeanName(AnnotationMetadata annotationMetadata, Map<String, Object> attributes) {
    // name & value are aliases
    String beanName = (String) attributes.get("value");
    if (!StringUtils.isEmpty(beanName)) {
        return beanName;
    } else {
        // generate bean name from class name
        String shortName = ClassUtils.getShortName(annotationMetadata.getClassName());
        return StringUtils.uncapitalize(shortName);
    }
}
 
Example 3
Project: spring-multitenancy   File: BasicMongoPersistentEntity.java   View Source Code Vote up 5 votes
public BasicMongoPersistentEntity(TypeInformation<T> info) {
	super(info);

	collection = StringUtils.uncapitalize(info.getType().getSimpleName());

	Document document = this.findAnnotation(Document.class);

	if (document != null && !document.name().isEmpty()) {
		collection = document.name();
	}
}
 
Example 4
Project: sos   File: EventRelProvider.java   View Source Code Vote up 4 votes
@Override
public String getCollectionResourceRelFor(Class<?> type) {
	return StringUtils.uncapitalize(type.getSimpleName());
}
 
Example 5
Project: spring-data-spanner   File: BasicSpannerPersistentEntity.java   View Source Code Vote up 4 votes
protected String extractTableNameFromClass(Class<?> entityClass) {
  return StringUtils.uncapitalize(entityClass.getSimpleName());
}
 
Example 6
Project: lams   File: AbstractInterceptorDrivenBeanDefinitionDecorator.java   View Source Code Vote up 4 votes
protected String getInterceptorNameSuffix(BeanDefinition interceptorDefinition) {
	return StringUtils.uncapitalize(ClassUtils.getShortName(interceptorDefinition.getBeanClassName()));
}
 
Example 7
Project: spring-multitenancy   File: BasicMongoPersistentEntityTest.java   View Source Code Vote up 3 votes
@Test public void
should_generate_the_collection_name_using_the_class_name(){
	
	ClassTypeInformation<?> info = ClassTypeInformation.from(ClassWithoutTheDocumentAnnotation.class);
	TypeInformation<?> type = info.specialize(info);
	
	BasicMongoPersistentEntity<?> persistentEntity = new BasicMongoPersistentEntity<>(type);
	
	String expected = StringUtils.uncapitalize(ClassWithoutTheDocumentAnnotation.class.getSimpleName());
	String collectionName = persistentEntity.getCollection();
	
	assertEquals("Failed to Generate Collection Name", expected, collectionName);
}