Class ValidateDefinition

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

    @Metadata(label="eip,transformation")
    @AsPredicate
    public class ValidateDefinition
    extends ExpressionNode
    Validates a message based on an expression
    • Constructor Detail

      • ValidateDefinition

        public ValidateDefinition()
      • ValidateDefinition

        public ValidateDefinition​(org.apache.camel.Expression expression)
      • ValidateDefinition

        public ValidateDefinition​(org.apache.camel.Predicate predicate)
    • Method Detail

      • 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
      • setExpression

        public void setExpression​(ExpressionDefinition expression)
        Expression to use for validation as a predicate. The expression should return either true or false. If returning false the message is invalid and an exception is thrown.
        Overrides:
        setExpression in class ExpressionNode
      • getFactory

        public org.apache.camel.spi.PredicateExceptionFactory getFactory()
      • getPredicateExceptionFactory

        public String getPredicateExceptionFactory()
      • setPredicateExceptionFactory

        public void setPredicateExceptionFactory​(String predicateExceptionFactory)
        The bean id of custom PredicateExceptionFactory to use for creating the exception when the validation fails. By default, Camel will throw PredicateValidationException. By using a custom factory you can control which exception to throw instead.
      • predicateExceptionFactory

        public ValidateDefinition predicateExceptionFactory​(org.apache.camel.spi.PredicateExceptionFactory factory)
        The custom PredicateExceptionFactory to use for creating the exception when the validation fails. By default, Camel will throw PredicateValidationException. By using a custom factory you can control which exception to throw instead.
      • predicateExceptionFactory

        public ValidateDefinition predicateExceptionFactory​(String ref)
        The bean id of the custom PredicateExceptionFactory to use for creating the exception when the validation fails. By default, Camel will throw PredicateValidationException. By using a custom factory you can control which exception to throw instead.