diff --git a/org.ektorp/src/main/java/org/ektorp/impl/jackson/EktorpAnnotationIntrospector.java b/org.ektorp/src/main/java/org/ektorp/impl/jackson/EktorpAnnotationIntrospector.java index 155a0885..e678b854 100644 --- a/org.ektorp/src/main/java/org/ektorp/impl/jackson/EktorpAnnotationIntrospector.java +++ b/org.ektorp/src/main/java/org/ektorp/impl/jackson/EktorpAnnotationIntrospector.java @@ -14,6 +14,7 @@ import org.ektorp.util.Predicate; import org.ektorp.util.ReflectionUtils; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.introspect.Annotated; import com.fasterxml.jackson.databind.introspect.AnnotatedClass; import com.fasterxml.jackson.databind.introspect.AnnotatedField; @@ -46,6 +47,7 @@ public boolean isIgnorableMethod(AnnotatedMethod m) { return names.contains(m.getName()); } + // deprecated as of Jackson 2.6 and not called at all by 2.7 @Override public String[] findPropertiesToIgnore(Annotated ac) { if(ac instanceof AnnotatedClass){ @@ -53,8 +55,29 @@ public String[] findPropertiesToIgnore(Annotated ac) { } return super.findPropertiesToIgnore(ac); } - - public String[] findPropertiesToIgnore(AnnotatedClass ac) { + + // deprecated as of Jackson 2.8 and not called at all by 2.9 + @Override + public String[] findPropertiesToIgnore(Annotated ac, boolean forSerialization) { + if(ac instanceof AnnotatedClass){ + return findPropertiesToIgnore((AnnotatedClass) ac); + } + return super.findPropertiesToIgnore(ac, forSerialization); + } + + @Override // since Jackson 2.9 + public JsonIgnoreProperties.Value findPropertyIgnorals(Annotated ac) + { + if(ac instanceof AnnotatedClass){ + String[] ignoredFields = findPropertiesToIgnore((AnnotatedClass) ac); + if (ignoredFields != null) { + return JsonIgnoreProperties.Value.forIgnoredProperties(ignoredFields); + } + } + return super.findPropertyIgnorals(ac); + } + + public String[] findPropertiesToIgnore(AnnotatedClass ac) { List ignoreFields = null; for (AnnotatedField f : ac.fields()) { if (isIgnorableField(f)) { diff --git a/pom.xml b/pom.xml index 3f2f6e41..75838efa 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.8.5 4.8.2 2.3 - 2.6.7 + 2.9.7 3.1.1.RELEASE 2.0.1 4.3