Package javax.xml.stream

Examples of javax.xml.stream.XMLReporter


         * immediate exceptions.
         */
        if (prob.getSeverity() >= XMLValidationProblem.SEVERITY_ERROR) {
            throw WstxValidationException.create(prob);
        }
        XMLReporter rep = mConfig.getXMLReporter();
        if (rep != null) {
            doReportProblem(rep, ErrorConsts.WT_VALIDATION, prob.getMessage(),
                            prob.getLocation());
        }
    }
View Full Code Here


    @Override
    public void doRun() throws IOException {
        LOG.debug("XMPP consumer thread starting");
        try {
            XMLInputFactory xif = XMLInputFactory.newInstance();
            xif.setXMLReporter(new XMLReporter() {
                public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException {
                    LOG.warn(message + " errorType: " + errorType + " relatedInfo: " + relatedInformation);
                }
            });
View Full Code Here

    public void run() {
        log.debug("XMPP consumer thread starting");

        try {
            XMLInputFactory xif = XMLInputFactory.newInstance();
            xif.setXMLReporter(new XMLReporter() {
                public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException {
                    log.warn(message + " errorType: " + errorType + " relatedInfo: " + relatedInformation);
                }
            });
View Full Code Here

        // Probably no point in comparing at all... is there?
        // But we can report a possible problem?
        String extEnc = _config.getExternalEncoding();
        if (extEnc != null && enc != null
            && !extEnc.equalsIgnoreCase(enc)) {
            XMLReporter rep = _config.getXMLReporter();
            if (rep != null) {
                Location loc = getLocation();
                rep.report(MessageFormat.format(ErrorConsts.W_MIXED_ENCODINGS,
                                                new Object[] { extEnc, enc }),
                           ErrorConsts.WT_XML_DECL,
                           this, loc);
            }
        }
View Full Code Here

    @Override
    public void doRun() throws IOException {
        LOG.debug("XMPP consumer thread starting");
        try {
            XMLInputFactory xif = XMLInputFactory.newInstance();
            xif.setXMLReporter(new XMLReporter() {
                @Override
                public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException {
                    LOG.warn(message + " errorType: " + errorType + " relatedInfo: " + relatedInformation);
                }
            });
View Full Code Here

        // Probably no point in comparing at all... is there?
        // But we can report a possible problem?
        String extEnc = _config.getExternalEncoding();
        if (extEnc != null && enc != null
            && !extEnc.equalsIgnoreCase(enc)) {
            XMLReporter rep = _config.getXMLReporter();
            if (rep != null) {
                Location loc = getLocation();
                rep.report(MessageFormat.format(ErrorConsts.W_MIXED_ENCODINGS,
                                                new Object[] { extEnc, enc }),
                           ErrorConsts.WT_XML_DECL,
                           this, loc);
            }
        }
View Full Code Here

    }

    public void reportProblem(String probType, String format, Object arg, Object arg2)
        throws XMLStreamException
    {
        XMLReporter rep = mConfig.getXMLReporter();
        if (rep != null) {
            _reportProblem(rep, probType,
                            MessageFormat.format(format, new Object[] { arg, arg2 }), null);
        }
    }
View Full Code Here

    public void reportProblem(Location loc, String probType,
                              String format, Object arg, Object arg2)
        throws XMLStreamException
    {
        XMLReporter rep = mConfig.getXMLReporter();
        if (rep != null) {
            String msg = (arg != null || arg2 != null) ?
                MessageFormat.format(format, new Object[] { arg, arg2 }) : format;
            _reportProblem(rep, probType, msg, loc);
        }
View Full Code Here

         *   immediate stream exception (by-passing reporter)
         */
        if (prob.getSeverity() > XMLValidationProblem.SEVERITY_ERROR) {
            throw WstxValidationException.create(prob);
        }
        XMLReporter rep = mConfig.getXMLReporter();
        if (rep != null) {
            _reportProblem(rep, prob);
        } else {
            /* If no reporter, regular non-fatal errors are to be reported
             * as exceptions as well, for backwards compatibility
View Full Code Here

        /* Ok, maybe the difference is just with endianness indicator?
         * (UTF-16BE vs. UTF-16)?
         */
        // !!! TBI

        XMLReporter rep = cfg.getXMLReporter();
        if (rep != null) {
            Location loc = getLocation();
            String msg = MessageFormat.format(ErrorConsts.W_MIXED_ENCODINGS,
                                              new Object[] { mFoundEncoding,
                                                             inputEnc });
            String type = ErrorConsts.WT_XML_DECL;
            /* 30-May-2008, tatus: Should wrap all the info as XMValidationProblem
             *    since that's Woodstox' contract wrt. relatedInformation field.
             */
            XMLValidationProblem prob = new XMLValidationProblem(loc, msg, XMLValidationProblem.SEVERITY_WARNING, type);
            rep.report(msg, type, prob, loc);
        }
    }
View Full Code Here

TOP

Related Classes of javax.xml.stream.XMLReporter

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.