Class TextSplitterPipe

All Implemented Interfaces:
FrankElement, HasApplicationContext, HasName, HasTransactionAttribute, IConfigurable, IForwardTarget, IPipe, IScopeProvider, IWithParameters, NameAware, EventThrowing, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle

@EnterpriseIntegrationPattern(TRANSLATOR) public class TextSplitterPipe extends FixedForwardPipe
Breaks up the text input in blocks of a maximum length. By default, the maximum block length is 160 characters, to enable them to be sent as SMS messages.
  • Constructor Details

    • TextSplitterPipe

      public TextSplitterPipe()
  • Method Details

    • doPipe

      public PipeRunResult doPipe(Message message, PipeLineSession session) throws PipeRunException
      Description copied from interface: IPipe
      This is where the action takes place. Pipes may only throw a PipeRunException, to be handled by the caller of this object. Implementations must either consume the message, or pass it on to the next Pipe in the PipeRunResult.
      Throws:
      PipeRunException
    • setMaxBlockLength

      public void setMaxBlockLength(int maxBlockLength)
      Set the maximum number of characters of a block
      Default value
      160
    • setSoftSplit

      public void setSoftSplit(boolean softSplit)
      If true, try to break up the message at spaces, instead of in the middle of words
      Default value
      false