Package edu.umd.cs.findbugs.xml

Examples of edu.umd.cs.findbugs.xml.XMLOutput


        return project;
    }

    public void writeXML(File f, @CheckForNull BugCollection bugCollection) throws IOException {
        OutputStream out = new FileOutputStream(f);
        XMLOutput xmlOutput = new OutputStreamXMLOutput(out);
        try {
            writeXML(xmlOutput, f, bugCollection);
        } finally {
            xmlOutput.finish();
        }
    }
View Full Code Here


            System.exit(1);
        }
    }

    public void writeAsXML(@WillClose OutputStream out) throws IOException {
        XMLOutput xmlOutput = new OutputStreamXMLOutput(out);

        try {
            xmlOutput.beginDocument();
            xmlOutput.openTag("FindBugsFilter");
            writeBodyAsXML(xmlOutput);
            xmlOutput.closeTag("FindBugsFilter");
        } finally {
            xmlOutput.finish();
        }
    }
View Full Code Here

        }
    }

    public void writeEnabledMatchersAsXML(@WillClose OutputStream out) throws IOException {

        XMLOutput xmlOutput = new OutputStreamXMLOutput(out);

        try {
            xmlOutput.beginDocument();
            xmlOutput.openTag("FindBugsFilter");
            Iterator<Matcher> i = childIterator();
            while (i.hasNext()) {
                Matcher child = i.next();
                if (!disabled.containsKey(child)) {
                    child.writeXML(xmlOutput, false);
                }
            }
            xmlOutput.closeTag("FindBugsFilter");
        } finally {
            xmlOutput.finish();
        }
    }
View Full Code Here

    /**
     * Report statistics as an XML document to given output stream.
     */
    public void reportSummary(@WillClose OutputStream out) throws IOException {
        XMLOutput xmlOutput = new OutputStreamXMLOutput(out);
        try {
            writeXML(xmlOutput);
        } finally {
            xmlOutput.finish();
        }
    }
View Full Code Here

     */
    @Override
    public void writeXML(@WillClose Writer out) throws IOException {
        assert project != null;
        bugsPopulated();
        XMLOutput xmlOutput;
        // if (project == null) throw new NullPointerException("No project");


        if (withMessages && cloud != null) {
            cloud.bugsPopulated();
View Full Code Here

        assertFalse(sm.match(bug));
    }

    private String writeXMLAndGetStringOutput(SourceMatcher matcher, boolean disabled) throws IOException {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        XMLOutput xmlOutput = new OutputStreamXMLOutput(outputStream);

        matcher.writeXML(xmlOutput, disabled);
        xmlOutput.finish();

        return outputStream.toString().trim();
    }
View Full Code Here

        new NotMatcher().originalMatcher();
    }

    private String writeXMLAndGetStringOutput(NotMatcher notMatcher) throws IOException {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        XMLOutput xmlOutput = new OutputStreamXMLOutput(outputStream);

        notMatcher.writeXML(xmlOutput, false);
        xmlOutput.finish();

        String xmlOutputCreated = outputStream.toString();
        return xmlOutputCreated;
    }
View Full Code Here

        assertTrue("ageInDays", output.contains("ageInDays="));
    }

    private String writeXML(BugInstance inst, BugCollection bc) throws IOException {
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        XMLOutput out = new OutputStreamXMLOutput(bout);
        inst.writeXML(out, bc, bc.getWithMessages());
        out.finish();
        return new String(bout.toByteArray(), "UTF-8");
    }
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.xml.XMLOutput

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.