Package org.apache.myfaces.trinidadinternal.convert

Examples of org.apache.myfaces.trinidadinternal.convert.GenericConverterFactory


    if (value == null)
      return;
   
    if (!(value instanceof Date))
    {
      GenericConverterFactory fac = GenericConverterFactory.getCurrentInstance();
      value = fac.convert(value, Date.class);
    }
    super.validate(context, component, value);
  }
View Full Code Here


    if (value == null)
      return;
   
    if (!(value instanceof Date))
    {
      GenericConverterFactory fac = GenericConverterFactory.getCurrentInstance();
      value = fac.convert(value, Date.class);
    }
    super.validate(context, component, value);
  }
View Full Code Here

          out.append(']');
          return;
        }
       
        GenericConverterFactory converter =
          GenericConverterFactory.getCurrentInstance();
        if (Byte.class == valueClass)
        {
          writeByte(out, ((Byte)attrValue).byteValue());
        }
        else if (converter.isConvertible(attrValue, Date.class))
        {
          Date date = (Date) converter.convert(attrValue, Date.class);
          writeDate(out, date);
        }
        else if (Double.class == valueClass)
        {
          writeDouble(out, ((Double)attrValue).doubleValue());
        }
        else if (Float.class == valueClass)
        {
          writeFloat(out, ((Float)attrValue).floatValue());
        }
        else if (Long.class == valueClass)
        {
          writeLong(out, ((Long)attrValue).longValue());
        }
        else if (Short.class == valueClass)
        {
          writeShort(out, ((Short)attrValue).shortValue());
        }
        else if (converter.isConvertible(attrValue, Number.class))
        {
          Number num = (Number) converter.convert(attrValue, Number.class);
          writeDouble(out, num.doubleValue());
        }
        else if (Map.class.isAssignableFrom(valueClass))
        {
          writeMap(out, ((Map)attrValue), escapeXML);
View Full Code Here

                                             submittedValue);
        if (converted instanceof Date)
          date = (Date) converted;
        else
        {
          GenericConverterFactory fac = GenericConverterFactory.getCurrentInstance();
          if (fac.isConvertible(converted, Date.class))
            date = (Date) fac.convert(converted, Date.class);
        }
      }
      // Not a big deal;  just means that an invalid value was entered,
      // so we'll launch the dialog showing nothing
      catch (ConverterException ce)
View Full Code Here

    FacesContext context,
    UIComponent  component,
    ReturnEvent  event)
  {
    Object returnValue = event.getReturnValue();
    GenericConverterFactory fac = GenericConverterFactory.getCurrentInstance();

    // If we got passed a Date object, send it back to String
    // land (where it needs to be for submitted values).
    if ((returnValue instanceof Date) || fac.isConvertible(returnValue, Date.class))
    {
      FacesBean bean = getFacesBean(component);
      Converter converter = getConverter(bean);
      if (converter == null)
        converter = getDefaultConverter(context, bean);
View Full Code Here

    if (value == null)
      return;
   
    if (!(value instanceof Date))
    {
      GenericConverterFactory fac = GenericConverterFactory.getCurrentInstance();
      value = fac.convert(value, Date.class);
    }
    super.validate(context, component, value);
  }
View Full Code Here

                                             submittedValue);
        if (converted instanceof Date)
          date = (Date) converted;
        else
        {
          GenericConverterFactory fac = GenericConverterFactory.getCurrentInstance();
          if (fac.isConvertible(converted, Date.class))
            date = (Date) fac.convert(converted, Date.class);
        }
      }
      // Not a big deal;  just means that an invalid value was entered,
      // so we'll launch the dialog showing nothing
      catch (ConverterException ce)
View Full Code Here

    FacesContext context,
    UIComponent  component,
    ReturnEvent  event)
  {
    Object returnValue = event.getReturnValue();
    GenericConverterFactory fac = GenericConverterFactory.getCurrentInstance();

    // If we got passed a Date object, send it back to String
    // land (where it needs to be for submitted values).
    if ((returnValue instanceof Date) || fac.isConvertible(returnValue, Date.class))
    {
      FacesBean bean = getFacesBean(component);
      Converter converter = getConverter(bean);
      if (converter == null)
        converter = getDefaultConverter(context, bean);
View Full Code Here

    if (value == null)
      return;
   
    if (!(value instanceof Date))
    {
      GenericConverterFactory fac = GenericConverterFactory.getCurrentInstance();
      value = fac.convert(value, Date.class);
    }
    super.validate(context, component, value);
  }
View Full Code Here

                                             submittedValue);
        if (converted instanceof Date)
          date = (Date) converted;
        else
        {
          GenericConverterFactory fac = GenericConverterFactory.getCurrentInstance();
          if (fac.isConvertible(converted, Date.class))
            date = (Date) fac.convert(converted, Date.class);
        }
      }
      // Not a big deal;  just means that an invalid value was entered,
      // so we'll launch the dialog showing nothing
      catch (ConverterException ce)
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.convert.GenericConverterFactory

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.