Top Description Inners Constructors Methods
com.fasterxml.jackson.jr.ob.api

public abstract Class ReaderWriterProvider

extends Object
Class Inheritance
Known Direct Subclasses
com.fasterxml.jackson.jr.ob.api.ReaderWriterProvider.Pair
Imports
com.fasterxml.jackson.jr.ob.impl.JSONReader, .JSONWriter, com.fasterxml.jackson.jr.type.ResolvedType

API to implement to provide custom ValueReaders and ValueWriters.
Since
2.10

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ReaderWriterProvider.Pair

Implementation that allows chaining of two providers, one (first) with higher precedence than the other (second).

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ValueReader
findCollectionReader(JSONReader readContext, Class<?> type, ResolvedType valueType, ValueReader readerForValues)

public ValueReader
findMapReader(JSONReader readContext, Class<?> type, ResolvedType valueType, ValueReader readerForValues)

public ValueReader
findValueReader(JSONReader
context object that may be needed for resolving dependant readers
readContext
,
Class<?>
Raw type of bean to find reader for
type
)

Method called to find custom reader for given type that is NOT one of special container types (java.util.Collection, java.util.Map): typically value is a scalar, Bean or Enum.

public ValueWriter
findValueWriter(JSONWriter writeContext, Class<?> type)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ReaderWriterProviderback to summary
public ReaderWriterProvider()

Method Detail

findCollectionReaderback to summary
public ValueReader findCollectionReader(JSONReader readContext, Class<?> type, ResolvedType valueType, ValueReader readerForValues)
findMapReaderback to summary
public ValueReader findMapReader(JSONReader readContext, Class<?> type, ResolvedType valueType, ValueReader readerForValues)
findValueReaderback to summary
public ValueReader findValueReader(JSONReader readContext, Class<?> type)

Method called to find custom reader for given type that is NOT one of special container types (java.util.Collection, java.util.Map): typically value is a scalar, Bean or Enum.

Parameters
readContext:JSONReader

context object that may be needed for resolving dependant readers

type:Class<?>

Raw type of bean to find reader for

findValueWriterback to summary
public ValueWriter findValueWriter(JSONWriter writeContext, Class<?> type)
com.fasterxml.jackson.jr.ob.api back to summary

public Class ReaderWriterProvider.Pair

extends ReaderWriterProvider
Class Inheritance

Implementation that allows chaining of two providers, one (first) with higher precedence than the other (second).
Since
2.11

Field Summary

Modifier and TypeField and Description
protected final ReaderWriterProvider
protected final ReaderWriterProvider

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public ValueReader
public ValueReader
public ValueReader
findValueReader(JSONReader
context object that may be needed for resolving dependant readers
ctxt
,
Class<?>
Raw type of bean to find reader for
type
)

Overrides com.fasterxml.jackson.jr.ob.api.ReaderWriterProvider.findValueReader.

Method called to find custom reader for given type that is NOT one of special container types (java.util.Collection, java.util.Map): typically value is a scalar, Bean or Enum.

public ValueWriter
public static ReaderWriterProvider

Returns:

Provider instance either constructed (2 non-null providers), or non-null provider given as-is, or, if both nulls, null.
of
(ReaderWriterProvider
Primary provider
primary
,
ReaderWriterProvider
Secondary provider
secondary
)

Factory method for "combining" given 2 providers so that if neither is null, a Pair is constructed; otherwise if one is non-null, that provider is returned; or if both are nulls, null is returned.

Field Detail

_primaryback to summary
protected final ReaderWriterProvider _primary
_secondaryback to summary
protected final ReaderWriterProvider _secondary

Constructor Detail

Pairback to summary
protected Pair(ReaderWriterProvider p, ReaderWriterProvider s)

Method Detail

findCollectionReaderback to summary
public ValueReader findCollectionReader(JSONReader ctxt, Class<?> type, ResolvedType valueType, ValueReader readerForValues)

Overrides com.fasterxml.jackson.jr.ob.api.ReaderWriterProvider.findCollectionReader.

Annotations
@Override
findMapReaderback to summary
public ValueReader findMapReader(JSONReader ctxt, Class<?> type, ResolvedType valueType, ValueReader readerForValues)

Overrides com.fasterxml.jackson.jr.ob.api.ReaderWriterProvider.findMapReader.

Annotations
@Override
findValueReaderback to summary
public ValueReader findValueReader(JSONReader ctxt, Class<?> type)

Overrides com.fasterxml.jackson.jr.ob.api.ReaderWriterProvider.findValueReader.

Doc from com.fasterxml.jackson.jr.ob.api.ReaderWriterProvider.findValueReader.

Method called to find custom reader for given type that is NOT one of special container types (java.util.Collection, java.util.Map): typically value is a scalar, Bean or Enum.

Parameters
ctxt:JSONReader

context object that may be needed for resolving dependant readers

type:Class<?>

Raw type of bean to find reader for

Annotations
@Override
findValueWriterback to summary
public ValueWriter findValueWriter(JSONWriter ctxt, Class<?> type)

Overrides com.fasterxml.jackson.jr.ob.api.ReaderWriterProvider.findValueWriter.

Annotations
@Override
ofback to summary
public static ReaderWriterProvider of(ReaderWriterProvider primary, ReaderWriterProvider secondary)

Factory method for "combining" given 2 providers so that if neither is null, a Pair is constructed; otherwise if one is non-null, that provider is returned; or if both are nulls, null is returned.

Parameters
primary:ReaderWriterProvider

Primary provider

secondary:ReaderWriterProvider

Secondary provider

Returns:ReaderWriterProvider

Provider instance either constructed (2 non-null providers), or non-null provider given as-is, or, if both nulls, null.