ObjectReader class final
A reader bound to one @JsonView: it reads only the properties of that
view and skips the others, with its mapper's settings.
Get one from ObjectMapper.readerWithView. Use it to accept input in
which a client may set only some properties, such as a profile update
that must not change the role (Jackson's ObjectReader).
// Properties outside the Editable view are ignored.
final user = mapper.readerWithView(Editable).readValue<User>(body);
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readList<
E> (String json, [TypeInfo< E> ? element]) → List<E> -
Returns a
List<E>read from the JSON arrayjson, with only the view's properties. -
readValue<
T> (String json, [TypeInfo< T> ? type]) → T -
Returns a
Tread from the JSON textjson, with only the view's properties. -
toString(
) → String -
A string representation of this object.
inherited
-
treeToValue<
T> (Object? tree, [TypeInfo< T> ? type]) → T -
Returns a
Tread from decoded JSON or a JsonNode, with only the view's properties.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited