Search in sources :

Example 1 with RuleSetWriter

use of net.sourceforge.pmd.RuleSetWriter in project pmd-eclipse-plugin by pmd.

the class RuleSetWriterImpl method write.

/**
 * Write a ruleset as an XML stream
 *
 * @param writer
 *            the output writer
 * @param ruleSet
 *            the ruleset to serialize
 */
public void write(OutputStream outputStream, RuleSet ruleSet) throws WriterException {
    try {
        RuleSetWriter ruleSetWriter = new RuleSetWriter(outputStream);
        ruleSetWriter.write(ruleSet);
        outputStream.flush();
    } catch (RuntimeException e) {
        throw new WriterException(e);
    } catch (IOException e) {
        throw new WriterException(e);
    }
}
Also used : IOException(java.io.IOException) RuleSetWriter(net.sourceforge.pmd.RuleSetWriter) IRuleSetWriter(net.sourceforge.pmd.eclipse.runtime.writer.IRuleSetWriter) WriterException(net.sourceforge.pmd.eclipse.runtime.writer.WriterException)

Aggregations

IOException (java.io.IOException)1 RuleSetWriter (net.sourceforge.pmd.RuleSetWriter)1 IRuleSetWriter (net.sourceforge.pmd.eclipse.runtime.writer.IRuleSetWriter)1 WriterException (net.sourceforge.pmd.eclipse.runtime.writer.WriterException)1