Class IsXmlPipe

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

@Forward(name="*", description="when {@literal thenForwardName} or {@literal elseForwardName} are used") @EnterpriseIntegrationPattern(ROUTER) public class IsXmlPipe extends AbstractPipe
Selects an exitState, based on whether the input is an XML string. The input is an XML string if it, after removing leading white-space characters, starts with '<'. The input message is also the output message.
Since:
4.3
Author:
Peter Leeuwenburgh
  • Constructor Details

    • IsXmlPipe

      public IsXmlPipe()
  • Method Details

    • doPipe

      public @NonNull PipeRunResult doPipe(@NonNull Message message, @NonNull 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
    • setThenForwardName

      public void setThenForwardName(String thenForwardName)
      Forward returned when true.
      Default value
      then
    • getThenForwardName

      public String getThenForwardName()
    • setElseForwardName

      public void setElseForwardName(String elseForwardName)
      Forward returned when 'false'.
      Default value
      else
    • getElseForwardName

      public String getElseForwardName()
    • isElseForwardOnEmptyInput

      public boolean isElseForwardOnEmptyInput()
    • setElseForwardOnEmptyInput

      public void setElseForwardOnEmptyInput(boolean b)
      Returns elseforward when the input is empty (or thenforward).
      Default value
      true
    • setPreserveInput

      public void setPreserveInput(boolean preserveInput)
      If set true, the result of the pipe is replaced with the original input (i.e. the input before configured replacements of getInputFromSessionKey, getInputFromFixedValue or emptyInputReplacement)

      Use this if you want to pass the original input message of this pipe to the branch, but want to select a branch based on a session-key value via IPipe.setGetInputFromSessionKey(String).

      Specified by:
      setPreserveInput in interface IPipe
      Overrides:
      setPreserveInput in class AbstractPipe