Package org.springframework.binding.convert

Examples of org.springframework.binding.convert.ConversionExecutionException


    return converter;
  }

  public Object execute(Object source) throws ConversionExecutionException {
    if (source != null && !sourceClass.isInstance(source)) {
      throw new ConversionExecutionException(source, getSourceClass(), getTargetClass(), "Source object "
          + source + " to convert is expected to be an instance of " + getSourceClass());
    }
    try {
      return converter.convertSourceToTargetClass(source, targetClass);
    } catch (Exception e) {
      throw new ConversionExecutionException(source, getSourceClass(), getTargetClass(), e);
    }
  }
View Full Code Here


  public Object execute(Object source) throws ConversionExecutionException {
    if (source == null || converter.getSourceClass().isInstance(source)) {
      try {
        return converter.convertSourceToTargetClass(source, targetClass);
      } catch (Exception e) {
        throw new ConversionExecutionException(source, getSourceClass(), getTargetClass(), e);
      }
    } else if (converter.getTargetClass().isInstance(source)) {
      try {
        return converter.convertTargetToSourceClass(source, sourceClass);
      } catch (Exception e) {
        throw new ConversionExecutionException(source, converter.getTargetClass(), getSourceClass(), e);
      }
    } else {
      throw new ConversionExecutionException(source, getSourceClass(), getTargetClass(), "Source object "
          + source + " to convert is expected to be an instance of [" + converter.getSourceClass().getName()
          + "] or [" + converter.getTargetClass().getName() + "]");
    }
  }
View Full Code Here

    return converter;
  }

  public Object execute(Object source) throws ConversionExecutionException {
    if (source != null && !sourceClass.isInstance(source)) {
      throw new ConversionExecutionException(source, getSourceClass(), getTargetClass(), "Source object "
          + source + " to convert is expected to be an instance of [" + getSourceClass().getName() + "]");
    }
    try {
      return converter.convertSourceToTargetClass(source, targetClass);
    } catch (Exception e) {
      throw new ConversionExecutionException(source, getSourceClass(), getTargetClass(), e);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.binding.convert.ConversionExecutionException

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.