Package org.apache.wicket.util.convert

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


                // and there is a non-null property type for the component
                if (getObjectClass() != null) {
                    // convert the String to the right type
                    IConverter converter = component.getConverter(getObjectClass());
                    if (converter != null) {
                        newValue = converter.convertToObject(string, null);
                    }
                }
            }
        }
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

    {
      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

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

    public void testConvertEmtpyString() {
        // Wicket forms rely on converters returning null from an empty string conversion
        IConverterLocator locator = tester.getApplication().getConverterLocator();
        IConverter convert = locator.getConverter(Integer.class);
        assertNotNull(convert);
        assertNull(convert.convertToObject("", Locale.getDefault()));
    }
}
View Full Code Here

    else
    {
      final IConverter converter = getConverter(getType());
      try
      {
        convertedInput = converter.convertToObject(getInput(), getLocale());
      }
      catch (ConversionException e)
      {
        ValidationError error = new ValidationError();
        if (e.getResourceKey() != null)
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

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

    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

    {
      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.