Package org.camunda.spin.spi
Interface DataFormatReader
-
- All Known Implementing Classes:
DomXmlDataFormatReader,JacksonJsonDataFormatReader,TextBasedDataFormatReader
public interface DataFormatReaderReads the internal representation of aSpinobject from its serialized representation.- Author:
- Daniel Meyer, Sebastian Menski, Thorben Lindhauer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanRead(java.io.Reader reader, int readLimit)Returns true if this reader estimates to be able to consume the input data.java.lang.ObjectreadInput(java.io.Reader reader)Read (or parse) a reader into this data format's input structure.
-
-
-
Method Detail
-
canRead
boolean canRead(java.io.Reader reader, int readLimit)Returns true if this reader estimates to be able to consume the input data. Implementations may not read more thanreadLimitbytes 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
java.lang.Object readInput(java.io.Reader reader)
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- aReaderproviding the data source- Returns:
- the read or parsed input
- Throws:
SpinDataFormatException- in case the reader cannot read the input
-
-