Package com.cognitect.transit.SPI
Interface ReaderSPI
-
public interface ReaderSPI
Interface for providing custom MapReader and ArrayReader implementations for a Reader to use when parsing native JSON or msgpack composite structures. This entry point exists to enable Transit libraries for other JVM languages to layer on top of the Java Transit library, but still get language-appropriate maps and arrays returned from a parse, while ensuring that parsing and decoding work correctly. This interface should never be used by applications that using this library.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Reader
setBuilders(MapReader<?,Map<Object,Object>,Object,Object> mapBuilder, ArrayReader<?,List<Object>,Object> listBuilder)
Specifies a custom MapReader and ArrayReader to use when parsing native maps and arrays in JSON or msgpack.
-
-
-
Method Detail
-
setBuilders
Reader setBuilders(MapReader<?,Map<Object,Object>,Object,Object> mapBuilder, ArrayReader<?,List<Object>,Object> listBuilder)
Specifies a custom MapReader and ArrayReader to use when parsing native maps and arrays in JSON or msgpack. Implementations must accept any type of input and must return a maps or lists of any type of content. This function must be called before Reader.read is called.- Parameters:
mapBuilder
- a custom MapReader that produces a Map of objects to objectslistBuilder
- a custom ArrayReader that yields a List of objects- Returns:
-
-