Package javax.xml.stream

Examples of javax.xml.stream.XMLReporter


    private XMLStreamReader createReader(StringReader stringReader) {
        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        if (inputFactory.isPropertySupported("javax.xml.stream.isValidating")) {
            inputFactory.setProperty("javax.xml.stream.isValidating", Boolean.FALSE);
        }
        inputFactory.setXMLReporter(new XMLReporter() {

            @Override
            public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException {
                System.out.println("Error:" + errorType + ", message : " + message);
            }
View Full Code Here


    private XMLStreamReader createReader(StringReader stringReader) {
        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        if (inputFactory.isPropertySupported("javax.xml.stream.isValidating")) {
            inputFactory.setProperty("javax.xml.stream.isValidating", Boolean.FALSE);
        }
        inputFactory.setXMLReporter(new XMLReporter() {

            @Override
            public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException {
                System.out.println("Error:" + errorType + ", message : " + message);
            }
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

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

        // First definition sticks...
        Object old;
        if (m.size() > 0 && (old = m.get(id)) != null) {
            // Application may want to know about the problem...
            XMLReporter rep = mConfig.getXMLReporter();
            if (rep != null) {
                EntityDecl oldED = (EntityDecl) old;
                String str = " entity '"+id+"' defined more than once: first declaration at "
                    + oldED.getLocation();
                if (isParam) {
View Full Code Here

        }

        // getting null means this is a dup...
        if (attr == null) {
            // anyone interested in knowing about possible problem?
            XMLReporter rep = mConfig.getXMLReporter();
            if (rep != null) {
                String msg = MessageFormat.format(ErrorConsts.W_DTD_ATTR_REDECL, new Object[] { attrName, elem });
                reportWarning(rep, ErrorConsts.WT_ATTR_DECL, msg, loc, elem);
            }
        } else {
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();
            rep.report(MessageFormat.format(ErrorConsts.W_MIXED_ENCODINGS,
                                            new Object[] { mFoundEncoding,
                                                           inputEnc }),
                       ErrorConsts.WT_XML_DECL,
                       this, loc);
        }
View Full Code Here

        doReportProblem(mConfig.getXMLReporter(), probType, msg, null);
    }

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

    }

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

    }

    public void reportProblem(String probType, String format, Object arg,
                              Object arg2, Location loc)
    {
        XMLReporter rep = mConfig.getXMLReporter();
        if (rep != null) {
            doReportProblem(rep, probType,
                            MessageFormat.format(format, new Object[] { arg, arg2 }),
                            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.