Class 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. {@see Validator} {@see InputTypeDefinition} {@see OutputTypeDefinition}

    • Constructor Detail

      • ValidatorDefinition

        public ValidatorDefinition()
    • Method Detail

      • 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'.
        Parameters:
        type - data type name
      • setType

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