Package org.frankframework.validation
Class XmlValidatorContentHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.xml.sax.ext.DefaultHandler2
org.frankframework.validation.XmlValidatorContentHandler
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,DeclHandler
,EntityResolver2
,LexicalHandler
SAX ContentHandler used during XML validation for some additional validation
checks and getting more information in case validation fails.
- Author:
- Gerrit van Brakel, Jaco de Groot
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Constructor Summary
ConstructorDescriptionXmlValidatorContentHandler
(Set<String> validNamespaces, RootValidations rootValidations, Map<List<String>, List<String>> invalidRootNamespaces, Boolean ignoreUnknownNamespaces) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkNamespaceExistance
(String namespace) void
void
endElement
(String namespaceURI, String lName, String qName) getXpath()
void
setXmlValidatorErrorHandler
(XmlValidatorErrorHandler xmlValidatorErrorHandler) void
startElement
(String namespaceURI, String lName, String qName, Attributes attrs) Methods inherited from class org.xml.sax.ext.DefaultHandler2
attributeDecl, comment, elementDecl, endCDATA, endDTD, endEntity, externalEntityDecl, getExternalSubset, internalEntityDecl, resolveEntity, resolveEntity, startCDATA, startDTD, startEntity
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
XmlValidatorContentHandler
public XmlValidatorContentHandler(Set<String> validNamespaces, RootValidations rootValidations, Map<List<String>, List<String>> invalidRootNamespaces, Boolean ignoreUnknownNamespaces) - Parameters:
validNamespaces
- validNamespacesgrammarsValidationrootValidations
- contains path's (just a single element in case of the root of the entire xml) to root elements which should be checked uponignoreUnknownNamespaces
-
-
-
Method Details
-
setXmlValidatorErrorHandler
-
startElement
public void startElement(String namespaceURI, String lName, String qName, Attributes attrs) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
endDocument
- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classDefaultHandler
- Throws:
SAXException
-
checkNamespaceExistance
protected void checkNamespaceExistance(String namespace) throws XmlValidatorContentHandler.UnknownNamespaceException -
getXpath
-
getXpath
-