Class AuthorizingSettableBeanProperty
- All Implemented Interfaces:
com.fasterxml.jackson.databind.BeanProperty,com.fasterxml.jackson.databind.util.Named,Serializable
SettableBeanProperty.Delegating that authorizes each property against the
ParameterAuthorizationContext before delegating to the underlying property's
deserializeAndSet. Unauthorized properties are silently dropped — the JSON value is
skipped via JsonParser.skipChildren(), so any nested object graph is never instantiated
and setter side effects on unauthorized properties never fire.
Path tracking for nested members is done by the AuthorizingValueDeserializer wrapped
around every property's value deserializer, so the direct path and the buffered creator path
compute the same paths. Values Jackson assigns after construction go through set(java.lang.Object, java.lang.Object) and
setAndReturn(java.lang.Object, java.lang.Object), which apply the same authorization to the already-materialized value.
When ParameterAuthorizationContext.isActive() is false, this wrapper is a
straight pass-through to the delegate — no overhead for default-config requests — except that a
creator parameter is never written after construction (see set(java.lang.Object, java.lang.Object)), and a polymorphic
property is never merged in place, a decision taken when the deserializer is built, see
DelegatingDeserializer.supportsUpdate(com.fasterxml.jackson.databind.DeserializationConfig).
- Since:
- 7.2.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.deser.SettableBeanProperty
com.fasterxml.jackson.databind.deser.SettableBeanProperty.DelegatingNested classes/interfaces inherited from interface com.fasterxml.jackson.databind.BeanProperty
com.fasterxml.jackson.databind.BeanProperty.Bogus, com.fasterxml.jackson.databind.BeanProperty.Std -
Field Summary
Fields inherited from class com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating
delegateFields inherited from class com.fasterxml.jackson.databind.deser.SettableBeanProperty
_contextAnnotations, _managedReferenceName, _nullProvider, _objectIdInfo, _propertyIndex, _propName, _type, _valueDeserializer, _valueTypeDeserializer, _viewMatcher, _wrapperName, MISSING_VALUE_DESERIALIZERFields inherited from class com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase
_aliases, _metadataFields inherited from interface com.fasterxml.jackson.databind.BeanProperty
EMPTY_FORMAT, EMPTY_INCLUDE -
Constructor Summary
ConstructorsConstructorDescriptionAuthorizingSettableBeanProperty(com.fasterxml.jackson.databind.deser.SettableBeanProperty delegate) Deprecated, for removal: This API element is subject to removal in a future version.AuthorizingSettableBeanProperty(com.fasterxml.jackson.databind.deser.SettableBeanProperty delegate, String memberName) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeAndSet(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt, Object instance) deserializeSetAndReturn(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt, Object instance) voidsetAndReturn(Object instance, Object value) protected com.fasterxml.jackson.databind.deser.SettableBeanPropertywithDelegate(com.fasterxml.jackson.databind.deser.SettableBeanProperty d) com.fasterxml.jackson.databind.deser.SettableBeanPropertywithValueDeserializer(com.fasterxml.jackson.databind.JsonDeserializer<?> deser) Creator-bound properties, and non-creator properties Jackson buffers while collecting creator parameters, never reachdeserializeAndSet(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, java.lang.Object)/deserializeSetAndReturn(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, java.lang.Object): Jackson calls thefinalSettableBeanProperty#deserializedirectly, through this property's own value deserializer.Methods inherited from class com.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating
_with, assignIndex, fixAccess, getAnnotation, getCreatorIndex, getDeclaringClass, getDelegate, getInjectableValueId, getManagedReferenceName, getMember, getObjectIdInfo, getPropertyIndex, getValueDeserializer, getValueTypeDeserializer, hasValueDeserializer, hasValueTypeDeserializer, hasViews, isInjectionOnly, visibleInView, withName, withNullProviderMethods inherited from class com.fasterxml.jackson.databind.deser.SettableBeanProperty
_throwAsIOE, _throwAsIOE, _throwAsIOE, _throwAsIOE, depositSchemaProperty, deserialize, deserializeWith, getContextAnnotation, getFullName, getInjectionDefinition, getName, getNullValueProvider, getType, getWrapperName, isIgnorable, isMerging, markAsIgnorable, setManagedReferenceName, setObjectIdInfo, setViews, toString, unwrapped, withSimpleNameMethods inherited from class com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase
findAliases, findFormatOverrides, findPropertyFormat, findPropertyInclusion, getMetadata, isRequired, isVirtual
-
Constructor Details
-
AuthorizingSettableBeanProperty
@Deprecated(since="7.4.0", forRemoval=true) public AuthorizingSettableBeanProperty(com.fasterxml.jackson.databind.deser.SettableBeanProperty delegate) Deprecated, for removal: This API element is subject to removal in a future version.keys authorization on the wire name; useAuthorizingSettableBeanProperty(SettableBeanProperty, String)with the Java member name -
AuthorizingSettableBeanProperty
public AuthorizingSettableBeanProperty(com.fasterxml.jackson.databind.deser.SettableBeanProperty delegate, String memberName) - Parameters:
memberName- the Java member name the authorizer resolves, which differs fromSettableBeanProperty.getName()once the property is renamed on the wire
-
-
Method Details
-
withDelegate
protected com.fasterxml.jackson.databind.deser.SettableBeanProperty withDelegate(com.fasterxml.jackson.databind.deser.SettableBeanProperty d) - Specified by:
withDelegatein classcom.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating
-
withValueDeserializer
public com.fasterxml.jackson.databind.deser.SettableBeanProperty withValueDeserializer(com.fasterxml.jackson.databind.JsonDeserializer<?> deser) Creator-bound properties, and non-creator properties Jackson buffers while collecting creator parameters, never reachdeserializeAndSet(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, java.lang.Object)/deserializeSetAndReturn(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, java.lang.Object): Jackson calls thefinalSettableBeanProperty#deserializedirectly, through this property's own value deserializer. Wrap that deserializer withAuthorizingValueDeserializerfor every property; it owns the path push for nested members on both the direct and the buffered path, and refuses the in-place merge of a polymorphic value that would otherwise skip both.- Overrides:
withValueDeserializerin classcom.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating
-
deserializeAndSet
public void deserializeAndSet(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt, Object instance) throws IOException - Overrides:
deserializeAndSetin classcom.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating- Throws:
IOException
-
deserializeSetAndReturn
public Object deserializeSetAndReturn(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt, Object instance) throws IOException - Overrides:
deserializeSetAndReturnin classcom.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating- Throws:
IOException
-
set
- Overrides:
setin classcom.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating- Throws:
IOException
-
setAndReturn
- Overrides:
setAndReturnin classcom.fasterxml.jackson.databind.deser.SettableBeanProperty.Delegating- Throws:
IOException
-
AuthorizingSettableBeanProperty(SettableBeanProperty, String)with the Java member name