Interface OutputSinkFactory


public interface OutputSinkFactory
  • Method Details

    • getSupportedSinks

      Return the classes of sink that this sink factory can provide for the given sink type. Note. You will always receive SinkClass.STRING, and should always support it. Returning null or an empty list is implicitly equal to returning [SinkClass.STRING].
      Parameters:
      sinkType - the kind of sink - see OutputSinkFactory.SinkType enum.
      available - the classes of data CFR has available for this sink.
      Returns:
      the subset (in preferential order) of available that you are equipped to handle. You will then be receive a call to getSink with one of these (probably the first one!).
    • getSink

      CFR wishes to sink output - return an implementation of Sink that takes the appropriate input for the SinkClass being sunk, or null. Null will cause a no-op sink to be inferred. Why has sink been done in this weakly typed way? So as to allow easy extension without breaking the ABI of the cfr jar. See OutputSinkFactory.SinkClass
      Type Parameters:
      T - the type of sinkClass's data. (tut tut!)
      Parameters:
      sinkType - the kind of sink - see OutputSinkFactory.SinkType enum.
      sinkClass - the class of sink. You select this in getSupportedSinks(SinkType, Collection)
      Returns:
      a sink capable of accepting sinkClass' data, or null. Null means you don't want the data.