public class CriteriaSanitizer<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
CriteriaSanitizer() |
| Modifier and Type | Method and Description |
|---|---|
void |
clean(T criteria)
Sanitize the criteria object in parameter.
|
protected boolean |
cleanField(T criteria,
String fieldName,
Class<?> fieldType,
Object fieldValue,
Method writeMethod)
You may override this method to confer a different handling per type / other criteria
If the method return false, the default behavior will be executed.
|
protected void |
defaultCleanField(T criteria,
String fieldName,
Class<?> fieldType,
Object fieldValue,
Method writeMethod)
The default behavior is to convert empty strings to null when empty.
|
protected boolean cleanField(T criteria, String fieldName, Class<?> fieldType, Object fieldValue, Method writeMethod)
criteria - : the criteria objectfieldName - : the field namefieldType - : the field typefieldValue - : the field valuewriteMethod - : The write method (in order to modify the parameter)protected void defaultCleanField(T criteria, String fieldName, Class<?> fieldType, Object fieldValue, Method writeMethod)
criteria - : the criteria objectfieldName - : the field namefieldType - : the field typefieldValue - : the field valuewriteMethod - : The write method (in order to modify the parameter)public void clean(T criteria)
criteria - the criteria object to be sanitizedCopyright © 2018–2019 Butor Inc.. All rights reserved.