public class XmlRuleValidator extends MessageValidatorImpl
XmlValidationService
to validate an XML message against various rules.
If the DocumentBuilderFactoryBuilder
has been explicitly set to be not namespace aware
and the document does in fact contain namespaces, then Saxon can cause merry havoc in the sense
that //NonNamespaceXpath
doesn't work if the document has namespaces in it. We have
included a shim so that behaviour can be toggled based on what you have configured.
XPath.newXPathInstance(DocumentBuilderFactoryBuilder, NamespaceContext)
,
ValidationStage
In the adapter configuration file this class is aliased as xml-rule-validator which is the preferred alternative to the fully qualified classname when building your configuration.
log
Constructor and Description |
---|
XmlRuleValidator() |
XmlRuleValidator(ValidationStage... stages) |
Modifier and Type | Method and Description |
---|---|
void |
addValidationStage(ValidationStage vs) |
KeyValuePairSet |
getNamespaceContext() |
java.util.List<ValidationStage> |
getValidationStages() |
DocumentBuilderFactoryBuilder |
getXmlDocumentFactoryConfig() |
void |
setNamespaceContext(KeyValuePairSet set)
Set the namespace context for resolving namespaces.
|
void |
setValidationStages(java.util.List<ValidationStage> l) |
void |
setXmlDocumentFactoryConfig(DocumentBuilderFactoryBuilder xml) |
void |
validate(AdaptrisMessage msg) |
prepare
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, init, start, stop
public XmlRuleValidator()
public XmlRuleValidator(ValidationStage... stages)
public void validate(AdaptrisMessage msg) throws CoreException
CoreException
public void addValidationStage(ValidationStage vs)
vs
- a ValidationStage
to apply.public java.util.List<ValidationStage> getValidationStages()
public void setValidationStages(java.util.List<ValidationStage> l)
public KeyValuePairSet getNamespaceContext()
public void setNamespaceContext(KeyValuePairSet set)
set
- the mapping for the namespace context.public DocumentBuilderFactoryBuilder getXmlDocumentFactoryConfig()
public void setXmlDocumentFactoryConfig(DocumentBuilderFactoryBuilder xml)