Package org.camunda.spin.spi
Class TextBasedDataFormatReader
- java.lang.Object
-
- org.camunda.spin.spi.TextBasedDataFormatReader
-
- All Implemented Interfaces:
DataFormatReader
- Direct Known Subclasses:
DomXmlDataFormatReader,JacksonJsonDataFormatReader
public abstract class TextBasedDataFormatReader extends java.lang.Object implements DataFormatReader
Can be used as a base class to determine whether an input reader is readable by applying regular expression matching.- Author:
- Lindhauer
-
-
Constructor Summary
Constructors Constructor Description TextBasedDataFormatReader()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancanRead(java.io.Reader input, int readLimit)Returns true if this reader estimates to be able to consume the input data.protected abstract java.util.regex.PatterngetInputDetectionPattern()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.camunda.spin.spi.DataFormatReader
readInput
-
-
-
-
Method Detail
-
canRead
public boolean canRead(java.io.Reader input, int readLimit)Description copied from interface:DataFormatReaderReturns true if this reader estimates to be able to consume the input data. Implementations may not read more thanreadLimitbytes from the supplied reader.- Specified by:
canReadin interfaceDataFormatReader- Parameters:
input- 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 methodDataFormatReader.readInput(Reader)is invoked.- Returns:
- true if this reader is able to consume the input
-
getInputDetectionPattern
protected abstract java.util.regex.Pattern getInputDetectionPattern()
-
-