Validator

Validator

Description: The Validator Component is for validating XML against a schema
Scheme: validator
Syntax: validator:resourceUri
Maven: org.apache.camel/camel-core/2.16.1
Name Kind Group Required Default Type Enum Description
resourceUri path producer true java.lang.String URL to a local resource on the classpath or a full URL to a remote resource or resource on the file system which contains the XSD to validate against.
failOnNullBody parameter producer true boolean Whether to fail if no body exists.
failOnNullHeader parameter producer true boolean Whether to fail if no header exists when validating against a header.
headerName parameter producer java.lang.String To validate against a header instead of the message body.
errorHandler parameter advanced org.apache.camel.processor.validation.ValidatorErrorHandler To use a custom org.apache.camel.processor.validation.ValidatorErrorHandler.

The default error handler captures the errors and throws an exception.

exchangePattern parameter advanced InOnly org.apache.camel.ExchangePattern InOnly
RobustInOnly
InOut
InOptionalOut
OutOnly
RobustOutOnly
OutIn
OutOptionalIn
Sets the default exchange pattern when creating an exchange.
resourceResolver parameter advanced org.w3c.dom.ls.LSResourceResolver To use a custom LSResourceResolver
schemaFactory parameter advanced javax.xml.validation.SchemaFactory To use a custom javax.xml.validation.SchemaFactory
schemaLanguage parameter advanced http://www.w3.org/2001/XMLSchema java.lang.String Configures the W3C XML Schema Namespace URI.
synchronous parameter advanced false boolean Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). @param synchronous true to enforce synchronous processing
useDom parameter advanced boolean Whether DOMSource/DOMResult or SaxSource/SaxResult should be used by the validator.
useSharedSchema parameter advanced true boolean Whether the Schema instance should be shared or not. This option is introduced to work around a JDK 1.6.x bug. Xerces should not have this issue.