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

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

Introduction

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

Prototype

public Class<?> getType() 

Source Link

Document

The type of the backing class, method parameter, field, or property described by this TypeDescriptor.

Usage

From source file:ru.mystamps.web.controller.converter.LinkEntityDtoGenericConverter.java

private static boolean isString(TypeDescriptor type) {
    return String.class.equals(type.getType());
}

From source file:ru.mystamps.web.controller.converter.LinkEntityDtoGenericConverter.java

private static boolean isDto(TypeDescriptor type) {
    return LinkEntityDto.class.equals(type.getType());
}

From source file:com._4dconcept.springframework.data.marklogic.core.convert.MarklogicConverters.java

private static JAXBContext initJAXBContext(TypeDescriptor type) throws JAXBException {
    final Class<?> typeClass = type.getType();
    if (cachedJAXBContext.containsKey(typeClass)) {
        return cachedJAXBContext.get(typeClass);
    } else {//from   w  w  w  .  j ava 2s.  c  om
        final JAXBContext jaxbContext = JAXBContext.newInstance(typeClass);
        cachedJAXBContext.put(typeClass, jaxbContext);
        return jaxbContext;
    }
}

From source file:org.agatom.springatom.webmvc.converters.StringToUnixTimestampConverter.java

/** {@inheritDoc} */
@Override//from   w w w  .j  a  va2s  .co  m
public boolean matches(final TypeDescriptor sourceType, final TypeDescriptor targetType) {
    return sourceType.getType().isAssignableFrom(String.class)
            && targetType.getType().isAssignableFrom(UnixTimestamp.class);
}

From source file:org.agatom.springatom.webmvc.converters.IntervalToStringConverter.java

/** {@inheritDoc} */
@Override//from  w w w.j  av a  2  s  .c om
public boolean matches(final TypeDescriptor sourceType, final TypeDescriptor targetType) {
    return sourceType.getType().isAssignableFrom(Interval.class)
            && targetType.getType().isAssignableFrom(String.class);
}

From source file:org.agatom.springatom.webmvc.converters.LongToDateTimeConverter.java

/** {@inheritDoc} */
@Override//from   w w w .  ja va2  s.  co m
public boolean matches(final TypeDescriptor sourceType, final TypeDescriptor targetType) {
    return sourceType.getType().isAssignableFrom(Long.class)
            && targetType.getType().isAssignableFrom(DateTime.class);
}

From source file:sample.data.mock.MockConversionService.java

public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
    return getRepository(targetType.getType(), sourceType.getType()) != null;
}

From source file:fr.mael.microrss.util.DozerConverter.java

/**
 * {@inheritDoc}//from  w  w w.java2s.co  m
 */
public Object convert(Object aSource, TypeDescriptor aSourceType, TypeDescriptor aTargetType) {
    Object o = mapper.map(aSource, aTargetType.getType());
    //      if (o instanceof WebFeed && aSource instanceof Feed) {
    //         WebFeed webFeed = (WebFeed) o;
    //         webFeed.setTitle(beanFactory.getBean(FeedService.class).getFeedTitle(webFeed.getId()));
    //      }
    return o;
}

From source file:org.fenixedu.bennu.spring.converters.LocalizedStringConverter.java

@Override
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
    return String.class.equals(sourceType.getType())
            && LocalizedString.class.isAssignableFrom(targetType.getType());
}

From source file:org.fenixedu.bennu.spring.DomainObjectConverter.java

@Override
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
    return String.class.equals(sourceType.getType())
            && DomainObject.class.isAssignableFrom(targetType.getType());
}