- java.lang.Object
- 
- org.omnifaces.converter.TrimConverter
 
- 
- Direct Known Subclasses:
- ToLowerCaseConverter,- ToUpperCaseConverter
 
 public class TrimConverter extends Object implements Converter<String> The omnifaces.TrimConverteris intented to trim any whitespace from submittedStringvalues. This keeps the data store free of whitespace pollution.This converter does by design no conversion in getAsString().UsageThis converter is available by converter ID omnifaces.TrimConverter. Just specify it in theconverterattribute of the component referring theStringproperty. For example:<h:inputText value="#{bean.username}" converter="omnifaces.TrimConverter" />You can also configure it application wide via below entry in faces-config.xmlwithout the need to specify it in every single input component:<converter> <converter-for-class>java.lang.String</converter-for-class> <converter-class>org.omnifaces.converter.TrimConverter</converter-class> </converter>- Since:
- 2.6
- Author:
- Bauke Scholtz
 
- 
- 
Field Summary- 
Fields inherited from interface jakarta.faces.convert.ConverterDATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME
 
- 
 - 
Constructor SummaryConstructors Constructor Description TrimConverter()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAsObject(FacesContext context, UIComponent component, String submittedValue)StringgetAsString(FacesContext context, UIComponent component, String modelValue)
 
- 
- 
- 
Method Detail- 
getAsObjectpublic String getAsObject(FacesContext context, UIComponent component, String submittedValue) - Specified by:
- getAsObjectin interface- Converter<String>
 
 - 
getAsStringpublic String getAsString(FacesContext context, UIComponent component, String modelValue) - Specified by:
- getAsStringin interface- Converter<String>
 
 
- 
 
-