Class GenericStringTrimConverter

  • All Implemented Interfaces:
    javax.faces.convert.Converter<Object>

    public class GenericStringTrimConverter
    extends Object
    implements javax.faces.convert.Converter<Object>
    Similar to StringTrimConverter, but does not register itself automatically and Object as its target type. The actual runtime type of the value should still be string String, but this converter is useful when your model has a type parameter that is set to String#. In this case, JSF will detect the type as Object and will not apply the StringTrimConverter. You can explicitly set this converter if you need the value to be trimmed.
    Since:
    7.0.11
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • GenericStringTrimConverter

        public GenericStringTrimConverter()
    • Method Detail

      • getAsObject

        public Object getAsObject​(javax.faces.context.FacesContext context,
                                  javax.faces.component.UIComponent component,
                                  String value)
        Specified by:
        getAsObject in interface javax.faces.convert.Converter<Object>
      • getAsString

        public String getAsString​(javax.faces.context.FacesContext context,
                                  javax.faces.component.UIComponent cmp,
                                  Object value)
        Specified by:
        getAsString in interface javax.faces.convert.Converter<Object>