Package org.apache.wicket.util.convert

Examples of org.apache.wicket.util.convert.IConverter.convertToObject()


      return object;
    }
    IConverter converter = converterSupplier.getConverter(clz);
    if (object instanceof String)
    {
      return converter.convertToObject((String)object, locale);
    }
    else if (clz == String.class)
    {
      return converter.convertToString(object, locale);
    }
View Full Code Here


      {
        // ignore that try it the other way
      }
      // go through string to convert to the right object.
      String tmp = converter.convertToString(object, locale);
      return converter.convertToObject(tmp, locale);
    }
  }
}
View Full Code Here

    {
      final IConverter converter = getConverter(getType());

      try
      {
        convertedInput = (T)converter.convertToObject(getInput(), getLocale());
      }
      catch (ConversionException e)
      {
        ValidationError error = new ValidationError();
        if (e.getResourceKey() != null)
View Full Code Here

    checkComponentTag(tag, "input");
    checkComponentTagAttribute(tag, "type", "checkbox");

    final String value = getValue();
    final IConverter converter = getConverter(Boolean.class);
    final Boolean checked = (Boolean)converter.convertToObject(value, getLocale());

    if (Boolean.TRUE.equals(checked))
    {
      tag.put("checked", "checked");
    }
View Full Code Here

    {
      final IConverter converter = getConverter(getType());

      try
      {
        convertedInput = (T)converter.convertToObject(getInput(), getLocale());
      }
      catch (ConversionException e)
      {
        ValidationError error = new ValidationError();
        if (e.getResourceKey() != null)
View Full Code Here

      return object;
    }
    IConverter converter = converterSupplier.getConverter(clz);
    if (object instanceof String)
    {
      return converter.convertToObject((String)object, locale);
    }
    else if (clz == String.class)
    {
      return converter.convertToString(object, locale);
    }
View Full Code Here

      {
        // ignore that try it the other way
      }
      // go through string to convert to the right object.
      String tmp = converter.convertToString(object, locale);
      return converter.convertToObject(tmp, locale);
    }
  }
}
View Full Code Here

    final Class<?> paramClass = parameterClasses[0];
    try
    {
      final IConverter converter = Application.get().getConverterLocator().getConverter(
        paramClass);
      final Object param = converter.convertToObject(value, locale);
      if (param == null)
      {
        throw new MarkupException("Unable to convert value '" + value + "' into " +
          paramClass + ". May be there is no converter for that type registered?");
      }
View Full Code Here

    checkComponentTag(tag, "input");
    checkComponentTagAttribute(tag, "type", "checkbox");

    final String value = getValue();
    final IConverter converter = getConverter(Boolean.class);
    final Boolean checked = (Boolean)converter.convertToObject(value, getLocale());

    if (Boolean.TRUE.equals(checked))
    {
      tag.put("checked", "checked");
    }
View Full Code Here

    {
      final IConverter converter = getConverter(getType());

      try
      {
        convertedInput = (T)converter.convertToObject(getInput(), getLocale());
      }
      catch (ConversionException e)
      {
        ValidationError error = new ValidationError();
        if (e.getResourceKey() != null)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.