Package org.adfemg.datacontrol.xml.provider.data

Examples of org.adfemg.datacontrol.xml.provider.data.DataProvidingException


            SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); // TODO: null???
            Schema schema = null;
            try {
                schema = factory.newSchema(getSchema(request));
            } catch (SAXException e) {
                throw new DataProvidingException("error parsing XML schema", e);
            }
            Validator validator = schema.newValidator();
            CollectingErrorHandler collector = new CollectingErrorHandler();
            validator.setErrorHandler(collector);
            try {
                validator.validate(new DOMSource(retval)); // TODO: can also accept additional Result arg. why?
            } catch (IOException e) {
                throw new DataProvidingException("error reading xml source", e);
            } catch (SAXException e) {
                throw new DataProvidingException("error validating xml", e);
            }
            // now check if any warnings or errors have been collected
            String msg = collector.getCombinedMessage(isFailOnWarning(request));
            if (StringUtils.isNotBlank(msg)) {
                throw new ValidationException("xml validation errors:\n" + msg);
View Full Code Here

TOP

Related Classes of org.adfemg.datacontrol.xml.provider.data.DataProvidingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.