As our example application has the LineSplitter operator, which is not part of the Apex library, we will use it as an example to illustrate the process of developing a custom operator.
Splitting a line into words is, of course, a simple stateless operation. Connectors and stateful transformations will be more involved, and there are many examples in the Apex library to look at for this.
Here is the line splitter:
public class LineSplitter extends BaseOperator
{
// default pattern for word-separators
private static final Pattern nonWordDefault = Pattern.compile
("[\\p{Punct}\\s]+");
private String nonWordStr; // configurable regex
private transient Pattern nonWord; // compiled regex
/**
* Output port on which words from the current file are emitted
*/
public final transient DefaultOutputPort...