*/
public class HateoasBeanPropertyFilter extends JsonBeanPropertyFilter {
public boolean isSerializable(Object obj, JsonGenerator jsonGenerator,
SerializerProvider serializerProvider, PropertyWriter writer) {
JsonStreamContext context = jsonGenerator.getOutputContext();
if ((context.getParent() != null) && (context.getParent().inArray())) {
// skip annotated fields if within array:
if (!annotationPresent(obj, writer.getName(), HateoasArrayExclude.class)) {
return true;
}
}
// Check if we should trigger reduced HATEOAS serialization for a nested object by
// looking for the annotation on the fields getter:
else if ((context.getParent() != null) && (context.getParent().inObject())) {
if (annotationPresent(obj, writer.getName(), HateoasInclude.class)) {
return true;
}
}
else {