List of usage examples for org.apache.commons.digester3 Digester setProperty
public void setProperty(String property, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
XMLReader
implementation. From source file:com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptorParser.java
private static Digester initDigester() throws SAXNotRecognizedException, SAXNotSupportedException { Digester digester = new Digester(); digester.setValidating(true);//from w w w.j av a 2 s . c o m digester.setErrorHandler(new ErrorHandler() { @Override public void warning(SAXParseException exception) throws SAXException { throw new SAXException("XML Schema validation of Plugin Descriptor(plugin.xml) failed", exception); } @Override public void error(SAXParseException exception) throws SAXException { throw new SAXException("XML Schema validation of Plugin Descriptor(plugin.xml) failed", exception); } @Override public void fatalError(SAXParseException exception) throws SAXException { throw new SAXException("XML Schema validation of Plugin Descriptor(plugin.xml) failed", exception); } }); digester.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", XMLConstants.W3C_XML_SCHEMA_NS_URI); digester.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", GoPluginDescriptorParser.class.getResourceAsStream("/plugin-descriptor.xsd")); return digester; }