@ComponentProfile(summary="Validate an XML document against a schema with pluggable behaviour", recommended=CacheConnection.class, since="3.10.2", tag="xml,schema") public class ExtendedXmlSchemaValidator extends BasicXmlSchemaValidator
XmlValidationService
to validate an XML message against a schema.
This differs from BasicXmlSchemaValidator
since it allows you to configure pluggable
behaviours when a validation error is encountered; if you want schema validation to fail
processing, then keep using BasicXmlSchemaValidator
as normal.
This validates an input XML document against a schema. After first use, it caches the schema for re-use against the URL that was resolved as an expression or from static configuration. This means that until first use, no attempt is made to access the schema URL.
In the adapter configuration file this class is aliased as extended-xml-schema-validator which is the preferred alternative to the fully qualified classname when building your configuration.
log
Constructor and Description |
---|
ExtendedXmlSchemaValidator() |
Modifier and Type | Method and Description |
---|---|
SchemaViolationHandler |
getSchemaViolationHandler() |
void |
setSchemaViolationHandler(SchemaViolationHandler handler)
Specific behaviour when schema violations are encountered.
|
protected SchemaViolationHandler |
violationHandler() |
ExtendedXmlSchemaValidator |
withSchemaViolationHandler(SchemaViolationHandler e) |
validate
close, getSchema, getSchemaCache, init, prepare, resolveFromCache, resolveSchema, setSchema, setSchemaCache, start, stop, withSchema, withSchemaCache
public SchemaViolationHandler getSchemaViolationHandler()
public void setSchemaViolationHandler(SchemaViolationHandler handler)
If not explicitly specified then each violation will be logged and an exception thrown once everything is logged.
handler
- the handler.public ExtendedXmlSchemaValidator withSchemaViolationHandler(SchemaViolationHandler e)
protected SchemaViolationHandler violationHandler()
violationHandler
in class BasicXmlSchemaValidator