public abstract class ReaderWriterModifier extends Object
ValueReader
s and
ValueWriter
s of all kinds (default scalar ones, custom ones,
POJO ones).Modifier and Type | Class and Description |
---|---|
static class |
ReaderWriterModifier.Pair
Implementation that allows chaining of two modifiers, one (first) with higher precedence
than the other (second).
|
Constructor and Description |
---|
ReaderWriterModifier() |
Modifier and Type | Method and Description |
---|---|
ValueReader |
modifyValueReader(JSONReader readContext,
Class<?> type,
ValueReader defaultReader)
Method called after
ValueReader to use has been constructed, but
before it is to be used for the first time. |
ValueWriter |
modifyValueWriter(JSONWriter writeContext,
Class<?> type,
ValueWriter defaultWriter)
Method called after
ValueWriter to use has been constructed, but
before it is to be used for the first time. |
ValueWriter |
overrideStandardValueWriter(JSONWriter writeContext,
Class<?> type,
int stdTypeId)
Method called instead of
modifyValueWriter(com.fasterxml.jackson.jr.ob.impl.JSONWriter, java.lang.Class<?>, com.fasterxml.jackson.jr.ob.api.ValueWriter) for set of non-POJO
"standard" JDK types that do not have matching ValueWriter and are
normally directly serialized by JSONWriter itself. |
POJODefinition |
pojoDefinitionForDeserialization(JSONReader readContext,
Class<?> pojoType) |
POJODefinition |
pojoDefinitionForSerialization(JSONWriter writeContext,
Class<?> pojoType) |
public POJODefinition pojoDefinitionForDeserialization(JSONReader readContext, Class<?> pojoType)
public POJODefinition pojoDefinitionForSerialization(JSONWriter writeContext, Class<?> pojoType)
public ValueReader modifyValueReader(JSONReader readContext, Class<?> type, ValueReader defaultReader)
ValueReader
to use has been constructed, but
before it is to be used for the first time. Method may either return that
reader as-is, or construct a different ValueReader
and return that
to be used.
This method is often used to create a new ValueReader
that needs to
delegate to the original reader for some uses, but not all.
readContext
- Context that may be used to access configurationtype
- Type of values to readdefaultReader
- ValueReader
that is to be useddefaultReader
as-is, or an alternate ValueReader
to use.public ValueWriter modifyValueWriter(JSONWriter writeContext, Class<?> type, ValueWriter defaultWriter)
ValueWriter
to use has been constructed, but
before it is to be used for the first time. Method may either return that
writer as-is, or construct a different ValueWriter
and return that
to be used.
Note that this method is NOT called for non-POJO JDK "standard" values that
jackson-jr supports (such as Number
s, String
and URL
); for these types, overrideStandardValueWriter(com.fasterxml.jackson.jr.ob.impl.JSONWriter, java.lang.Class<?>, int)
is called instead.
This method is often used to create a new ValueReader
that needs to
delegate to the original reader for some uses, but not all.
writeContext
- Context that may be used to access configurationtype
- Type of values to writedefaultWriter
- ValueReader
that is to be useddefaultReader
as-is, or an alternate ValueWriter
to use;
must not return null
.public ValueWriter overrideStandardValueWriter(JSONWriter writeContext, Class<?> type, int stdTypeId)
modifyValueWriter(com.fasterxml.jackson.jr.ob.impl.JSONWriter, java.lang.Class<?>, com.fasterxml.jackson.jr.ob.api.ValueWriter)
for set of non-POJO
"standard" JDK types that do not have matching ValueWriter
and are
normally directly serialized by JSONWriter
itself.
Handler may either return null
to indicate "no override" or return
custom ValueWriter
to use.writeContext
- Context that may be used to access configurationtype
- Type of values to writestdTypeId
- Internal identifier of standard type (not usually useful,
but could potentially be used for delegating)null
if no override should occur, or ValueWriter
to use.Copyright © 2020 FasterXML. All rights reserved.