Class ValidatorDefinition

java.lang.Object
org.apache.camel.model.validator.ValidatorDefinition
Direct Known Subclasses:
CustomValidatorDefinition, EndpointValidatorDefinition, PredicateValidatorDefinition

@Metadata(label="validation") public abstract class ValidatorDefinition extends Object

Represents a Validator which declaratively validates message content according to the input type declared by InputTypeDefinition and/or output type declared by OutputTypeDefinition.

If you specify type='xml:ABC', the validator will be picked up when current message type is 'xml:ABC'. If you specify type='json', then it will be picked up for all of json validation.

  • Constructor Details

    • ValidatorDefinition

      public ValidatorDefinition()
  • Method Details

    • getType

      public String getType()
    • setType

      public void setType(String type)
      Set the data type name. If you specify 'xml:XYZ', the validator will be picked up if message type is 'xml:XYZ'. If you specify just 'xml', the validator matches with all of 'xml' message type like 'xml:ABC' or 'xml:DEF'.
    • setType

      public void setType(Class<?> clazz)
      Set the data type using Java class.