minor work towards using the new read-only/write-only/read-write access mode indicator
diff --git a/src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertyBuilder.java b/src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertyBuilder.java
index 70cfed2..b9b909c 100644
--- a/src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertyBuilder.java
+++ b/src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertyBuilder.java
@@ -3,6 +3,7 @@
import java.util.*;
import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.util.EmptyIterator;
@@ -537,6 +538,16 @@
return _annotationIntrospector.findSerializationInclusion(am, null);
}
+ @Override
+ public JsonProperty.Access findAccess() {
+ return fromMemberAnnotationsExcept(new WithMember<JsonProperty.Access>() {
+ @Override
+ public JsonProperty.Access withMember(AnnotatedMember member) {
+ return _annotationIntrospector.findPropertyAccess(member);
+ }
+ }, JsonProperty.Access.AUTO);
+ }
+
/*
/**********************************************************
/* Data aggregation
@@ -913,6 +924,40 @@
}
return result;
}
+
+ protected <T> T fromMemberAnnotationsExcept(WithMember<T> func, T defaultValue)
+ {
+ if (_annotationIntrospector != null) {
+ if (_forSerialization) {
+ if (_getters != null) {
+ T result = func.withMember(_getters.value);
+ if ((result != null) && (result != defaultValue)) {
+ return result;
+ }
+ }
+ } else {
+ if (_ctorParameters != null) {
+ T result = func.withMember(_ctorParameters.value);
+ if ((result != null) && (result != defaultValue)) {
+ return result;
+ }
+ }
+ if (_setters != null) {
+ T result = func.withMember(_setters.value);
+ if ((result != null) && (result != defaultValue)) {
+ return result;
+ }
+ }
+ }
+ if (_fields != null) {
+ T result = func.withMember(_fields.value);
+ if ((result != null) && (result != defaultValue)) {
+ return result;
+ }
+ }
+ }
+ return null;
+ }
/*
/**********************************************************