Class Source<I>

java.lang.Object
ca.mcscert.jpipe.compiler.model.Source<I>
Type Parameters:
I - type produced for the downstream transformation.
Direct Known Subclasses:
FileSource

public abstract class Source<I> extends Object
First step of a compilation chain: reads an input file and produces the initial value fed to the first Transformation.
  • Constructor Details

    • Source

      public Source()
  • Method Details

    • of

      public static <I> Source<I> of(Source.Provider<I> provider)
      Create a Source from a lambda or method reference.
    • provideFrom

      public abstract I provideFrom(String sourceName) throws IOException
      Read sourceName and produce the initial pipeline value.
      Parameters:
      sourceName - path to the input file.
      Returns:
      an instance of I.
      Throws:
      IOException - if the file cannot be read.
    • andThen

      public final <R> ChainBuilder<I,R> andThen(Transformation<I,R> next)
      DSL entry-point: combine this source with the first transformation to start building a compilation chain.
      Type Parameters:
      R - output type of next.
      Parameters:
      next - the transformation to apply to this source's output.
      Returns:
      a ChainBuilder accumulating further steps.