Package org.apache.wicket.util.convert

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


      private static final long serialVersionUID = 1L;

      @Override
      public IConverter getConverter(Class<?> type)
      {
        IConverter c = AjaxEditableLabel.this.getConverter(type);
        return c != null ? c : super.getConverter(type);
      }

      @Override
      protected void onModelChanged()
View Full Code Here


      private static final long serialVersionUID = 1L;

      @Override
      public IConverter getConverter(Class<?> type)
      {
        IConverter c = AjaxEditableLabel.this.getConverter(type);
        return c != null ? c : super.getConverter(type);
      }

      @Override
      protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
View Full Code Here

    if (modelObject != null)
    {
      // Get converter
      final Class<?> objectClass = modelObject.getClass();

      final IConverter converter = getConverter(objectClass);

      // Model string from property
      final String modelString = converter.convertToString(modelObject, getLocale());

      if (modelString != null)
      {
        // If we should escape the markup
        if (getFlag(FLAG_ESCAPE_MODEL_STRINGS))
View Full Code Here

    if (modelObject != null)
    {
      // Get converter
      final Class<?> objectClass = modelObject.getClass();

      final IConverter converter = getConverter(objectClass);

      // Model string from property
      final String modelString = converter.convertToString(modelObject, getLocale());

      if (modelString != null)
      {
        // If we should escape the markup
        if (getFlag(FLAG_ESCAPE_MODEL_STRINGS))
View Full Code Here

        reportValidationError(e, error);
      }
    }
    else
    {
      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

    if (modelObject != null)
    {
      // Get converter
      final Class<?> objectClass = modelObject.getClass();

      final IConverter converter = getConverter(objectClass);

      // Model string from property
      final String modelString = converter.convertToString(modelObject, getLocale());

      if (modelString != null)
      {
        // If we should escape the markup
        if (getFlag(FLAG_ESCAPE_MODEL_STRINGS))
View Full Code Here

          Class<?> objectClass = (displayObject == null ? null : displayObject.getClass());


          if (objectClass != null && objectClass != String.class)
          {
            final IConverter converter = Application.get()
              .getConverterLocator()
              .getConverter(objectClass);

            displayValue = converter.convertToString(displayObject, getLocale());
          }
        }

        if (Strings.isEmpty(displayValue))
        {
View Full Code Here

          {
            return null;
          }
          else
          {
            IConverter converter = getConverter(value.getClass());
            if (converter == null)
            {
              return Strings.toString(value);
            }
            else
            {
              return converter.convertToString(value, getLocale());
            }
          }
        }
      }.toString();
    }
View Full Code Here

    // Convert the parameter if necessary, depending on the setter's
    // attribute
    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

        error((IValidationError)error);
      }
    }
    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

TOP

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

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.