Class FilterDefinition

All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.LineNumberAware, Block, HasExpressionType, OutputNode, org.apache.camel.NamedNode, org.apache.camel.spi.HasCamelContext, org.apache.camel.spi.HasId, org.apache.camel.spi.IdAware

@Metadata(label="eip,routing") @AsPredicate public class FilterDefinition extends OutputExpressionNode
Filter out messages based using a predicate
  • Constructor Details

    • FilterDefinition

      public FilterDefinition()
    • FilterDefinition

      public FilterDefinition(ExpressionDefinition expression)
    • FilterDefinition

      public FilterDefinition(org.apache.camel.Predicate predicate)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getShortName

      public String getShortName()
    • getLabel

      public String getLabel()
      Description copied from class: ProcessorDefinition
      Returns a label to describe this node such as the expression if some kind of expression node
      Specified by:
      getLabel in interface org.apache.camel.NamedNode
      Overrides:
      getLabel in class ExpressionNode
    • getStatusPropertyName

      public String getStatusPropertyName()
    • setStatusPropertyName

      public void setStatusPropertyName(String statusPropertyName)
    • setExpression

      public void setExpression(ExpressionDefinition expression)
      Expression to determine if the message should be filtered or not. If the expression returns an empty value or false then the message is filtered (dropped), otherwise the message is continued being routed.
      Overrides:
      setExpression in class ExpressionNode
    • statusPropertyName

      public FilterDefinition statusPropertyName(String statusPropertyName)
      Name of exchange property to use for storing the status of the filtering. Setting this allows to know if the filter predicate evaluated as true or false.