Package org.springframework.binding.convert.converters

Examples of org.springframework.binding.convert.converters.ObjectToArray


    if (targetClass.isArray()) {
      if (Collection.class.isAssignableFrom(sourceClass)) {
        Converter collectionToArray = new ReverseConverter(new ArrayToCollection(this));
        return new StaticConversionExecutor(sourceClass, targetClass, collectionToArray);
      } else {
        return new StaticConversionExecutor(sourceClass, targetClass, new ObjectToArray(this));
      }
    }
    Converter converter = findRegisteredConverter(sourceClass, targetClass);
    if (converter != null) {
      // we found a converter
View Full Code Here


                    + sourceClass.getName() + "] to array holding elements of type ["
                    + targetComponentType.getName() + "]");
          }
          ConversionExecutor elementConverter = new StaticConversionExecutor(sourceClass,
              targetComponentType, converter);
          return new StaticConversionExecutor(sourceClass, targetClass, new ObjectToArray(elementConverter));
        } else if (converter.getTargetClass().isAssignableFrom(sourceClass)
            && converter instanceof TwoWayConverter) {
          if (!converter.getSourceClass().isAssignableFrom(targetComponentType)) {
            throw new ConversionExecutorNotFoundException(sourceClass, targetClass,
                "Custom ConversionExecutor with id '" + id + "' cannot convert from sourceClass ["
                    + sourceClass.getName() + "] to array holding elements of type ["
                    + targetComponentType.getName() + "]");
          }
          TwoWayConverter twoWay = (TwoWayConverter) converter;
          ConversionExecutor elementConverter = new StaticConversionExecutor(sourceClass,
              targetComponentType, new ReverseConverter(twoWay));
          return new StaticConversionExecutor(sourceClass, targetClass, new ObjectToArray(elementConverter));
        }
      }
    }
    if (Collection.class.isAssignableFrom(targetClass)) {
      if (Collection.class.isAssignableFrom(sourceClass)) {
View Full Code Here

TOP

Related Classes of org.springframework.binding.convert.converters.ObjectToArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.