Package org.xml.sax

Examples of org.xml.sax.ErrorHandler


                }
            });
            // Use AtomicReference to allow make variable final, not for atomicity
            // We store only last exception
            final AtomicReference<SAXParseException> exceptionRef = new AtomicReference<SAXParseException>();
            builder.setErrorHandler(new ErrorHandler() {

                public void warning(SAXParseException exception) throws SAXException {
                    log.warn(Util.getMessage("ParseFailure"), exception);
                }
View Full Code Here


    }
  }
 
  public Object convertDataValueToObjectValue(Object dataValue, Session session, XMLUnmarshaller unmarshaller) {
    if(dataValue instanceof org.w3c.dom.Element) {
      ErrorHandler handler = unmarshaller.getErrorHandler();
      Result result = null;
      if(handler != null && handler instanceof JAXBErrorHandler) {
        result = domHandler.createUnmarshaller(((JAXBErrorHandler)handler).getValidationEventHandler());
      } else {
        result = domHandler.createUnmarshaller(null);
View Full Code Here

    DocumentBuilder builder = factory.newDocumentBuilder();
    ByteArrayInputStream bais = new ByteArrayInputStream(response);

    // Parse the XML.
    //
    builder.setErrorHandler(new ErrorHandler() {

      public void error(SAXParseException exception) throws SAXException {
        // fail quietly
      }
View Full Code Here

    DocumentBuilder builder = factory.newDocumentBuilder();
    ByteArrayInputStream bais = new ByteArrayInputStream(response);

    // Parse the XML.
    //
    builder.setErrorHandler(new ErrorHandler() {

      public void error(SAXParseException exception) throws SAXException {
        // fail quietly
      }
View Full Code Here

        // Set schema location
        parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", schema);

        // Set the error handler
        parser.setErrorHandler(new ErrorHandler() {
            public void error(SAXParseException exception) throws SAXParseException {
                throw exception;
            }

            public void fatalError(SAXParseException exception) throws SAXParseException {
View Full Code Here

        }
        fIncludeLocations.addElement((Object)location);

        DOMParser parser = new IgnoreWhitespaceParser();
        parser.setEntityResolver( (fEntityResolver != null)? (fEntityResolver):(new Resolver()) );
        parser.setErrorHandlernew ErrorHandler()
            {
                public void fatalError(SAXParseException ex) throws SAXException {
                    StringBuffer str = new StringBuffer();
                    String systemId_ = ex.getSystemId();
                    if (systemId_ != null) {
View Full Code Here

            return;
        }

        DOMParser parser = new IgnoreWhitespaceParser();
        parser.setEntityResolver( (fEntityResolver != null)? (fEntityResolver):(new Resolver()) );
        parser.setErrorHandlernew ErrorHandler() );

        try {
            parser.setFeature("http://xml.org/sax/features/validation", false);
            parser.setFeature("http://xml.org/sax/features/namespaces", true);
            parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false);
View Full Code Here

            return null;
        }

         DOMParser parser = new IgnoreWhitespaceParser();
         parser.setEntityResolver( (fEntityResolver != null)? (fEntityResolver):(new Resolver()) );
         parser.setErrorHandler( new ErrorHandler  ()
            {
                public void fatalError(SAXParseException ex) throws SAXException {
                    StringBuffer str = new StringBuffer();
                    String systemId_ = ex.getSystemId();
                    if (systemId_ != null) {
View Full Code Here

            dbf.setNamespaceAware(true);
            dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
            dbf.setAttribute(JAXP_SCHEMA_SOURCE, xsdInputStream);

            DocumentBuilder db = dbf.newDocumentBuilder();
            db.setErrorHandler(new ErrorHandler() {
                public void warning(SAXParseException exception) {
                    if(LOGGER.isInfoEnabled())
                        LOGGER.info("Validation warning validating config file \"" + resourcePath +
                            "\" against XML Schema \"" + SCHEMA_RESOLVER.getResourcePath());
                }
View Full Code Here

                dbf.setAttribute(JAXP_SCHEMA_SOURCE, xsdInputStream);

                DocumentBuilder db = dbf.newDocumentBuilder();

                /* add an ErrorHandler that just logs validation problems */
                db.setErrorHandler(new ErrorHandler() {
                    public void warning(SAXParseException exception) {
                        _log.info("Validation warning validating config file \"" + _configFilePath + "\" against XML Schema \"" + SCHEMA_RESOLVER.getResourcePath());
                    }

                    public void error(SAXParseException exception) {
View Full Code Here

TOP

Related Classes of org.xml.sax.ErrorHandler

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.