Example usage for org.springframework.core.convert TypeDescriptor getName

List of usage examples for org.springframework.core.convert TypeDescriptor getName

Introduction

In this page you can find the example usage for org.springframework.core.convert TypeDescriptor getName.

Prototype

public String getName() 

Source Link

Document

Return the name of this type: the fully qualified class name.

Usage

From source file:org.opentides.bean.converter.StringToBaseEntityConverter.java

@Override
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
    String serviceName = NamingUtil.toAttributeName(NamingUtil.getSimpleName(targetType.getName())) + "Service";
    BaseCrudService<?> service = (BaseCrudService<?>) beanFactory.getBean(serviceName);
    return service.load(source.toString());
}

From source file:org.opentides.bean.converter.StringToBaseEntityConverter.java

@Override
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
    String serviceName = NamingUtil.toAttributeName(NamingUtil.getSimpleName(targetType.getName())) + "Service";
    Object service = beanFactory.getBean(serviceName);
    if (service != null && BaseCrudService.class.isAssignableFrom(service.getClass()))
        return true;
    return false;
}