Package org.camunda.spin.spi
Interface DataFormatReader
- All Known Implementing Classes:
DomXmlDataFormatReader
,JacksonJsonDataFormatReader
,TextBasedDataFormatReader
public interface DataFormatReader
Reads the internal representation of a
Spin
object from its serialized representation.- Author:
- Daniel Meyer, Sebastian Menski, Thorben Lindhauer
-
Method Summary
-
Method Details
-
canRead
Returns true if this reader estimates to be able to consume the input data. Implementations may not read more thanreadLimit
bytes from the supplied reader.- Parameters:
reader
- reader that can be read from to detect a data formatreadLimit
- positive number that poses a restriction on how many characters an implementation may read. Reading beyond this limit may lead to incomplete input when the methodreadInput(Reader)
is invoked.- Returns:
- true if this reader is able to consume the input
-
readInput
Read (or parse) a reader into this data format's input structure. For example, an Xml-Based data format may return an internal tree structure which can be used for traversing the xml tree.- Parameters:
reader
- aReader
providing the data source- Returns:
- the read or parsed input
- Throws:
SpinDataFormatException
- in case the reader cannot read the input
-