Package dev.enola.common.io.object
Interface ObjectReader
- All Known Subinterfaces:
ObjectReaderWriter
- All Known Implementing Classes:
CsvReader,JacksonObjectReaderWriterChain,JsonObjectReaderWriter,ObjectReaderChain,ObjectReaderWriterChain,TemplatedObjectReader,YamlObjectReaderWriter
public interface ObjectReader
-
Method Summary
Modifier and TypeMethodDescription<T> Optional<T> optional(ReadableResource resource, Class<T> type) Read an object of Class T from the resource, if present.default <T> Tread(ReadableResource resource, Class<T> type) <T> Iterable<T> readArray(ReadableResource resource, Class<T> type) Read e.g.<T> Iterable<T> readStream(ReadableResource resource, Class<T> type) Read e.g.
-
Method Details
-
optional
Read an object of Class T from the resource, if present.- Throws:
IOException
-
readArray
Read e.g. a JSON (or YAML) [ ... ] array.- Throws:
IOException
-
readStream
Read e.g. a YAML stream. (For formats such as plain JSON which do not directly support a streams syntax, this will always return a single element.)- Throws:
IOException
-
read
- Throws:
IOException
-