Module dev.metaschema.databind
Interface IModelInstanceWriteHandler<ITEM>
- Type Parameters:
ITEM- the Java type of items being written
- All Known Implementing Classes:
AbstractModelInstanceWriteHandler
public interface IModelInstanceWriteHandler<ITEM>
Handler interface for writing model instance collections during
serialization.
This interface provides methods for iterating over collection items and writing them to an output stream.
-
Method Summary
Modifier and TypeMethodDescriptionvoidWrite the next item in the collection of items represented by the instance.voidWrite items from a list collection.voidWrite items from a map collection.default voidwriteSingleton(ITEM item) Write a singleton item.
-
Method Details
-
writeSingleton
Write a singleton item.- Parameters:
item- the item to write- Throws:
IOException- if an error occurred while writing the output
-
writeList
Write items from a list collection.- Parameters:
items- the list of items to write- Throws:
IOException- if an error occurred while writing the output
-
writeMap
Write items from a map collection.- Parameters:
items- the map of items to write, keyed by JSON key flag value- Throws:
IOException- if an error occurred while writing the output
-
writeItem
Write the next item in the collection of items represented by the instance.- Parameters:
item- the item Java object to write- Throws:
IOException- if an error occurred while parsing the input
-