Module dev.metaschema.databind
Interface IModelInstanceReadHandler<ITEM>
- Type Parameters:
ITEM- the Java type of items being read
- All Known Implementing Classes:
AbstractModelInstanceReadHandler
public interface IModelInstanceReadHandler<ITEM>
Handler interface for reading model instance collections during
deserialization.
This interface provides methods for accepting individual items read from a stream and combining them into a collection.
-
Method Summary
Modifier and TypeMethodDescriptionGet the name of the JSON key flag, if one is configured for this instance.readItem()Read the next item in the collection of items represented by the instance.readList()Read items into a list collection.readMap()Read items into a map collection, keyed by JSON key flag value.default ITEMRead a singleton item.
-
Method Details
-
readSingleton
Read a singleton item.- Returns:
- the item read, or
nullif no item was present - Throws:
IOException- if an error occurred while reading the input
-
readList
Read items into a list collection.- Returns:
- the list of items read
- Throws:
IOException- if an error occurred while reading the input
-
readMap
Read items into a map collection, keyed by JSON key flag value.- Returns:
- the map of items read, keyed by JSON key flag value
- Throws:
IOException- if an error occurred while reading the input
-
readItem
Read the next item in the collection of items represented by the instance.- Returns:
- the Java object representing the item, or
nullif no items remain to be read - Throws:
IOException- if an error occurred while parsing the input
-
getJsonKeyFlagName
Get the name of the JSON key flag, if one is configured for this instance.- Returns:
- the JSON key flag name, or
nullif no JSON key is configured
-