Class TextBasedDataFormatReader

java.lang.Object
org.camunda.spin.spi.TextBasedDataFormatReader
All Implemented Interfaces:
DataFormatReader
Direct Known Subclasses:
DomXmlDataFormatReader, JacksonJsonDataFormatReader

public abstract class TextBasedDataFormatReader extends 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 Details

    • TextBasedDataFormatReader

      public TextBasedDataFormatReader()
  • Method Details

    • canRead

      public boolean canRead(Reader input, int readLimit)
      Description copied from interface: DataFormatReader
      Returns true if this reader estimates to be able to consume the input data. Implementations may not read more than readLimit bytes from the supplied reader.
      Specified by:
      canRead in interface DataFormatReader
      Parameters:
      input - reader that can be read from to detect a data format
      readLimit - 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 method DataFormatReader.readInput(Reader) is invoked.
      Returns:
      true if this reader is able to consume the input
    • getInputDetectionPattern

      protected abstract Pattern getInputDetectionPattern()