com.googlecode.jslint4java.ant
Class XmlResultFormatter

java.lang.Object
  extended by com.googlecode.jslint4java.ant.XmlResultFormatter
All Implemented Interfaces:
ResultFormatter

public class XmlResultFormatter
extends java.lang.Object
implements ResultFormatter

Write out JSLint problems to an XML file. This may be easily transformed into a nice report. Sample output:

  <jslint>
    <file name="bad.js">
      <issue line="0" char="0" reason="Insufficient Llamas" evidence="var sheep;"/>
    </file>
    <file name="good.js"/>
  </jslint>
 

Version:
$Id: XmlResultFormatter.java 141 2007-12-20 08:39:30Z happygiraffe.net $
Author:
dom

Constructor Summary
XmlResultFormatter()
           
 
Method Summary
 void begin()
          Called at the start of JSLintTask execution.
 void end()
          Write out the XML file containing the issues for all files.
 void output(java.lang.String name, java.util.List<Issue> issues)
          Create a "file" element, containing nested "issue" elements.
 void setOut(java.io.OutputStream os)
          Called during initialization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlResultFormatter

public XmlResultFormatter()
Method Detail

begin

public void begin()
Description copied from interface: ResultFormatter
Called at the start of JSLintTask execution.

Specified by:
begin in interface ResultFormatter

end

public void end()
Write out the XML file containing the issues for all files.

Specified by:
end in interface ResultFormatter
See Also:
ResultFormatter.end()

output

public void output(java.lang.String name,
                   java.util.List<Issue> issues)
Create a "file" element, containing nested "issue" elements. Each issue will have line, char, reason and evidence attributes. An element will be created for all files, regardless of any issues being uncovered.

Specified by:
output in interface ResultFormatter
Parameters:
name - The file just examined.
issues - A list of issues fond with this file. May be empty.
See Also:
ResultFormatter.output(String, List)

setOut

public void setOut(java.io.OutputStream os)
Description copied from interface: ResultFormatter
Called during initialization.

Specified by:
setOut in interface ResultFormatter


Copyright © 2007-2009. All Rights Reserved.