Class SanitizingConverter
- java.lang.Object
-
- org.primefaces.extensions.converter.SanitizingConverter
-
- All Implemented Interfaces:
java.io.Serializable,javax.faces.convert.Converter<java.lang.Object>
public class SanitizingConverter extends java.lang.Object implements javax.faces.convert.Converter<java.lang.Object>, java.io.SerializableConverterwhich sanitizes any input using an OWASP Java HTML Sanitizer PolicyFactory. Useful for cleansing input if going to be displayed in outputText with escape="false".- Since:
- 10.0.5
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SanitizingConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetAsObject(javax.faces.context.FacesContext fc, javax.faces.component.UIComponent uic, java.lang.String value)java.lang.StringgetAsString(javax.faces.context.FacesContext fc, javax.faces.component.UIComponent uic, java.lang.Object o)org.owasp.html.PolicyFactorygetPolicy()booleanisDecodeHtml()java.lang.Stringsanitize(java.lang.String value)Method to facilitate "mis-using" this class to sanitize data coming over the networkvoidsetDecodeHtml(boolean decodeHtml)voidsetPolicy(org.owasp.html.PolicyFactory policy)
-
-
-
Method Detail
-
sanitize
public java.lang.String sanitize(java.lang.String value)
Method to facilitate "mis-using" this class to sanitize data coming over the network- Parameters:
value- the value to sanitize- Returns:
- sanitized string
-
getAsObject
public java.lang.Object getAsObject(javax.faces.context.FacesContext fc, javax.faces.component.UIComponent uic, java.lang.String value)- Specified by:
getAsObjectin interfacejavax.faces.convert.Converter<java.lang.Object>
-
getAsString
public java.lang.String getAsString(javax.faces.context.FacesContext fc, javax.faces.component.UIComponent uic, java.lang.Object o)- Specified by:
getAsStringin interfacejavax.faces.convert.Converter<java.lang.Object>
-
getPolicy
public org.owasp.html.PolicyFactory getPolicy()
-
setPolicy
public void setPolicy(org.owasp.html.PolicyFactory policy)
-
isDecodeHtml
public boolean isDecodeHtml()
-
setDecodeHtml
public void setDecodeHtml(boolean decodeHtml)
-
-