aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/fasterxml/jackson/databind/deser/BuilderBasedDeserializer.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/fasterxml/jackson/databind/deser/BuilderBasedDeserializer.java')
-rw-r--r--src/main/java/com/fasterxml/jackson/databind/deser/BuilderBasedDeserializer.java35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/BuilderBasedDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/BuilderBasedDeserializer.java
index fa15ed319..44bff9d3c 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/BuilderBasedDeserializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/BuilderBasedDeserializer.java
@@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.cfg.CoercionAction;
import com.fasterxml.jackson.databind.deser.impl.*;
import com.fasterxml.jackson.databind.introspect.AnnotatedMethod;
+import com.fasterxml.jackson.databind.util.IgnorePropertiesUtil;
import com.fasterxml.jackson.databind.util.NameTransformer;
import com.fasterxml.jackson.databind.util.TokenBuffer;
@@ -51,8 +52,20 @@ public class BuilderBasedDeserializer
Set<String> ignorableProps, boolean ignoreAllUnknown,
boolean hasViews)
{
+ this(builder, beanDesc, targetType, properties, backRefs, ignorableProps, ignoreAllUnknown, null, hasViews);
+ }
+
+ /**
+ * @since 2.12
+ */
+ public BuilderBasedDeserializer(BeanDeserializerBuilder builder,
+ BeanDescription beanDesc, JavaType targetType,
+ BeanPropertyMap properties, Map<String, SettableBeanProperty> backRefs,
+ Set<String> ignorableProps, boolean ignoreAllUnknown, Set<String> includableProps,
+ boolean hasViews)
+ {
super(builder, beanDesc, properties, backRefs,
- ignorableProps, ignoreAllUnknown, hasViews);
+ ignorableProps, ignoreAllUnknown, includableProps, hasViews);
_targetType = targetType;
_buildMethod = builder.getBuildMethod();
// 05-Mar-2012, tatu: Cannot really make Object Ids work with builders, not yet anyway
@@ -106,7 +119,11 @@ public class BuilderBasedDeserializer
}
public BuilderBasedDeserializer(BuilderBasedDeserializer src, Set<String> ignorableProps) {
- super(src, ignorableProps);
+ this(src, ignorableProps, src._includableProps);
+ }
+
+ public BuilderBasedDeserializer(BuilderBasedDeserializer src, Set<String> ignorableProps, Set<String> includableProps) {
+ super(src, ignorableProps, includableProps);
_buildMethod = src._buildMethod;
_targetType = src._targetType;
}
@@ -133,8 +150,8 @@ public class BuilderBasedDeserializer
}
@Override
- public BeanDeserializerBase withIgnorableProperties(Set<String> ignorableProps) {
- return new BuilderBasedDeserializer(this, ignorableProps);
+ public BeanDeserializerBase withIgnorableProperties(Set<String> ignorableProps, Set<String> includableProps) {
+ return new BuilderBasedDeserializer(this, ignorableProps, includableProps);
}
@Override
@@ -396,7 +413,7 @@ public class BuilderBasedDeserializer
}
// As per [JACKSON-313], things marked as ignorable should not be
// passed to any setter
- if (_ignorableProps != null && _ignorableProps.contains(propName)) {
+ if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) {
handleIgnoredProperty(p, ctxt, handledType(), propName);
continue;
}
@@ -599,7 +616,7 @@ public class BuilderBasedDeserializer
continue;
}
// ignorable things should be ignored
- if (_ignorableProps != null && _ignorableProps.contains(propName)) {
+ if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) {
handleIgnoredProperty(p, ctxt, bean, propName);
continue;
}
@@ -665,7 +682,7 @@ public class BuilderBasedDeserializer
buffer.bufferProperty(prop, prop.deserialize(p, ctxt));
continue;
}
- if (_ignorableProps != null && _ignorableProps.contains(propName)) {
+ if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) {
handleIgnoredProperty(p, ctxt, handledType(), propName);
continue;
}
@@ -710,7 +727,7 @@ public class BuilderBasedDeserializer
}
continue;
}
- if (_ignorableProps != null && _ignorableProps.contains(propName)) {
+ if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) {
handleIgnoredProperty(p, ctxt, builder, propName);
continue;
}
@@ -770,7 +787,7 @@ public class BuilderBasedDeserializer
continue;
}
// ignorable things should be ignored
- if (_ignorableProps != null && _ignorableProps.contains(propName)) {
+ if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) {
handleIgnoredProperty(p, ctxt, bean, propName);
continue;
}