Package com.fasterxml.jackson.jr.ob.api
Class ReaderWriterProvider.Pair
java.lang.Object
com.fasterxml.jackson.jr.ob.api.ReaderWriterProvider
com.fasterxml.jackson.jr.ob.api.ReaderWriterProvider.Pair
- Enclosing class:
- ReaderWriterProvider
Implementation that allows chaining of two providers, one (first) with higher precedence
than the other (second).
- Since:
- 2.11
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.jr.ob.api.ReaderWriterProvider
ReaderWriterProvider.Pair -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ReaderWriterProviderprotected final ReaderWriterProvider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindCollectionReader(JSONReader ctxt, Class<?> type, ResolvedType valueType, ValueReader readerForValues) findMapReader(JSONReader ctxt, Class<?> type, ResolvedType valueType, ValueReader readerForValues) findValueReader(JSONReader ctxt, Class<?> type) Method called to find custom reader for given type that is NOT one of special container types (Collection,Map): typically value is a scalar, Bean or Enum.findValueWriter(JSONWriter ctxt, Class<?> type) static ReaderWriterProviderof(ReaderWriterProvider primary, ReaderWriterProvider secondary) Factory method for "combining" given 2 providers so that if neither isnull, aReaderWriterProvider.Pairis constructed; otherwise if one is non-null, that provider is returned; or if both arenulls,nullis returned.
-
Field Details
-
_primary
-
_secondary
-
-
Constructor Details
-
Pair
-
-
Method Details
-
of
Factory method for "combining" given 2 providers so that if neither isnull, aReaderWriterProvider.Pairis constructed; otherwise if one is non-null, that provider is returned; or if both arenulls,nullis returned.- Parameters:
primary- Primary providersecondary- Secondary provider- Returns:
- Provider instance either constructed (2 non-null providers), or non-null provider
given as-is, or, if both nulls,
null.
-
findValueReader
Description copied from class:ReaderWriterProviderMethod called to find custom reader for given type that is NOT one of special container types (Collection,Map): typically value is a scalar, Bean or Enum.- Overrides:
findValueReaderin classReaderWriterProvider- Parameters:
ctxt- context object that may be needed for resolving dependant readerstype- Raw type of bean to find reader for
-
findCollectionReader
public ValueReader findCollectionReader(JSONReader ctxt, Class<?> type, ResolvedType valueType, ValueReader readerForValues) - Overrides:
findCollectionReaderin classReaderWriterProvider
-
findMapReader
public ValueReader findMapReader(JSONReader ctxt, Class<?> type, ResolvedType valueType, ValueReader readerForValues) - Overrides:
findMapReaderin classReaderWriterProvider
-
findValueWriter
- Overrides:
findValueWriterin classReaderWriterProvider
-