Package net.sf.isolation.conversion

Examples of net.sf.isolation.conversion.IsoConversionException


    if (type == Date.class) {
      try {
        return value == null ? null : getDateFormat().parse(
            (String) value);
      } catch (ParseException exception) {
        throw new IsoConversionException(String.valueOf(value),
            exception);
      }
    }
    if (type == String.class) {
      try {
        return value == null ? null : getDateFormat().format(
            (Date) value);
      } catch (ClassCastException exception) {
        throw new IsoConversionException(String.valueOf(value),
            exception);
      }
    }
    throw new IsoConversionNotSupportedException(type.getName());
  }
View Full Code Here


      }
      if (type == Byte.class) {
        return value == null ? null : Byte.valueOf((String) value);
      }
    } catch (ClassCastException exception) {
      throw new IsoConversionException(String.valueOf(value), exception);
    }
    if (type == String.class) {
      return value == null ? null : value.toString();
    }
    throw new IsoConversionNotSupportedException(type.getName());
View Full Code Here

      }
      if (type == BigDecimal.class) {
        return value == null ? null : new BigDecimal((String) value);
      }
    } catch (ClassCastException exception) {
      throw new IsoConversionException(String.valueOf(value), exception);
    }
    if (type == String.class) {
      return value == null ? null : value.toString();
    }
    throw new IsoConversionNotSupportedException(type.getName());
View Full Code Here

  public Object convert(Class<?> type, Object value)
      throws IsoConversionException {
    if (type == String.class) {
      return value == null ? value : value.toString();
    }
    throw new IsoConversionException(type.getName());
  }
View Full Code Here

    if (type == Date.class) {
      try {
        return value == null ? null : getDateFormat().parse(
            (String) value);
      } catch (ParseException exception) {
        throw new IsoConversionException(String.valueOf(value),
            exception);
      }
    }
    if (type == String.class) {
      try {
        return value == null ? null : getDateFormat().format(
            (Date) value);
      } catch (ClassCastException exception) {
        throw new IsoConversionException(String.valueOf(value),
            exception);
      }
    }
    throw new IsoConversionNotSupportedException(type.getName());
  }
View Full Code Here

      }
      if (type == Byte.class) {
        return value == null ? null : Byte.valueOf((String) value);
      }
    } catch (ClassCastException exception) {
      throw new IsoConversionException(String.valueOf(value), exception);
    }
    if (type == String.class) {
      return value == null ? null : value.toString();
    }
    throw new IsoConversionNotSupportedException(type.getName());
View Full Code Here

TOP

Related Classes of net.sf.isolation.conversion.IsoConversionException

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.