Package org.apache.wicket.util.convert

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


    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

  {
    Object value = PropertyResolver.getValue(variableName, model);

    if (value != null)
    {
      final IConverter converter = getConverter(value.getClass());
      if (converter != null)
      {
        return converter.convertToString(value, Session.get().getLocale());
      }
      else
      {
        return value.toString();
      }
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

    settings.put("button", "\"" + triggerButton.getPath() + "\"");
  }

  protected DateConverter getDateConverter()
  {
    IConverter converter = target.getConverter(Date.class);
    if (converter instanceof DateConverter)
    {
      return (DateConverter)converter;
    }
    return super.getDateConverter();
View Full Code Here

            final String string = (String)newValue;
            if (!Strings.isEmpty(string)) {
                // 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

  }

    @Override
  protected DateConverter getDateConverter()
  {
    IConverter converter = target.getConverter(Date.class);
    if (converter instanceof DateConverter)
    {
      return (DateConverter)converter;
    }
    return super.getDateConverter();
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<?> c = o.getClass();

            String s;

            IConverter converter = Application.get().getConverterLocator().getConverter(c);

            if (converter == null)
            {
              s = o.toString();
            }
            else
            {
              s = converter.convertToString(o, Session.get().getLocale());
            }

            out.print(quoteValue(s));
          }
        }
View Full Code Here

    Class<?> objectClass = displayValue == null ? null : displayValue.getClass();
    // Get label for choice
    String label = "";
    if (objectClass != null && objectClass != String.class)
    {
      @SuppressWarnings("rawtypes")
      IConverter converter = getConverter(objectClass);
      label = converter.convertToString(displayValue, getLocale());
    }
    else if (displayValue != null)
    {
      label = displayValue.toString();
    }
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.