Code example for Field

Methods: isAnnotationPresent

0
 
public class EscapeValuePostProcessor implements FieldPostProcessor { 
 
	@Override 
	public boolean accepts(final Resource resource, final Field field, final Object value) {
		return (value instanceof String) && !field.isAnnotationPresent(Unescaped.class);
	} 
 
	@Override 
	public Object processValue(final Resource resource, final Field field, final Object value) {
		return Utf8StringEscapeUtils.escapeUtf8Html((String) value);
	} 
 
}