Package org.apache.wicket.util.convert

Examples of org.apache.wicket.util.convert.ConversionException


      {
        setMethod.setAccessible(true);
        Object converted = converter.convert(value, getMethod.getReturnType());
        if (converted == null && value != null)
        {
          throw new ConversionException("Can't convert value: " + value + " to class: " +
            getMethod.getReturnType() + " for setting it on " + object);
        }
        try
        {
          setMethod.invoke(object, new Object[] { index, converted });
View Full Code Here


        converted = converter.convert(value, getMethod.getReturnType());
        if (converted == null)
        {
          if (value != null)
          {
            throw new ConversionException("Can't convert value: " + value +
              " to class: " + getMethod.getReturnType() + " for setting it on " +
              object);
          }
          else if (getMethod.getReturnType().isPrimitive())
          {
            throw new ConversionException(
              "Can't convert null value to a primitive class: " +
                getMethod.getReturnType() + " for setting it on " + object);
          }
        }
      }
View Full Code Here

            return new java.sql.Timestamp(newSimpleDateFormatUsingDateTimePattern().parse(valueStr).getTime());
        } catch (ParseException ex) {
            try {
                return new java.sql.Timestamp(newSimpleDateFormatUsingDatePattern().parse(valueStr).getTime());
            } catch (ParseException ex2) {
                throw new ConversionException("Value cannot be converted as a date/time", ex);
            }
        }
    }
View Full Code Here

      if (setMethod != null)
      {
        Object converted = converter.convert(value, getMethod.getReturnType());
        if (converted == null && value != null)
        {
          throw new ConversionException("Can't convert value: " + value + " to class: " +
            getMethod.getReturnType() + " for setting it on " + object);
        }
        try
        {
          setMethod.invoke(object, new Object[] { index, converted });
View Full Code Here

        converted = converter.convert(value, getMethod.getReturnType());
        if (converted == null)
        {
          if (value != null)
          {
            throw new ConversionException("Can't convert value: " + value +
              " to class: " + getMethod.getReturnType() + " for setting it on " +
              object);
          }
          else if (getMethod.getReturnType().isPrimitive())
          {
            throw new ConversionException(
              "Can't convert null value to a primitive class: " +
                getMethod.getReturnType() + " for setting it on " + object);
          }
        }
      }
View Full Code Here

    {
      return Strings.toBoolean(tmp);
    }
    catch (StringValueConversionException e)
    {
      throw new ConversionException("Invalid boolean input value posted \"" + getInput() +
        "\"", e).setTargetType(Boolean.class);
    }
  }
View Full Code Here

      if (setMethod != null)
      {
        Object converted = converter.convert(value, getMethod.getReturnType());
        if (converted == null && value != null)
        {
          throw new ConversionException("Can't convert value: " + value + " to class: " +
            getMethod.getReturnType() + " for setting it on " + object);
        }
        try
        {
          setMethod.invoke(object, new Object[] { index, converted });
View Full Code Here

        Object converted = converter.convert(value, getMethod.getReturnType());
        if (converted == null)
        {
          if (value != null)
          {
            throw new ConversionException("Can't convert value: " + value +
              " to class: " + getMethod.getReturnType() + " for setting it on " +
              object);
          }
          else if (getMethod.getReturnType().isPrimitive())
          {
            throw new ConversionException(
              "Can't convert null value to a primitive class: " +
                getMethod.getReturnType() + " for setting it on " + object);
          }
        }
        try
View Full Code Here

      Date date = format.parse(value);
      return new Time(date.getTime());
    }
    catch (ParseException e)
    {
      throw new ConversionException("Cannot parse '" + value + "' using format " + format).setSourceValue(
        value)
        .setTargetType(getTargetType())
        .setConverter(this)
        .setLocale(locale);
    }
View Full Code Here

      if (setMethod != null)
      {
        Object converted = converter.convert(value, getMethod.getReturnType());
        if (converted == null && value != null)
        {
          throw new ConversionException("Can't convert value: " + value + " to class: " +
            getMethod.getReturnType() + " for setting it on " + object);
        }
        try
        {
          setMethod.invoke(object, new Object[] { index, converted });
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.convert.ConversionException

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.