com.googlecode.jslint4java.ant
Class XmlResultFormatter

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

public class XmlResultFormatter
extends 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>
 

Author:
dom

Constructor Summary
XmlResultFormatter()
           
 
Method Summary
 void begin()
          Called at the start of JSLintTask execution.
protected  JSLintResultFormatter createFormatter()
          Create and return the JSLintResultFormatter used by this ant result formatter.
 void end()
          Write out the XML file containing the issues for all files.
 void output(JSLintResult result)
          Create a "file" element, containing nested "issue" elements.
 void setFile(File file)
          Called during initialization.
 void setStdout(OutputStream defaultOutputStream)
          If you want to write to stdout, you can't just use System.out, because we're in the middle of ant task.
 
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

createFormatter

protected JSLintResultFormatter createFormatter()
Create and return the JSLintResultFormatter used by this ant result formatter.


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(JSLintResult result)
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:
result - The details if this JSLint run.

setFile

public void setFile(File file)
Description copied from interface: ResultFormatter
Called during initialization. The file to where output should be written.

Specified by:
setFile in interface ResultFormatter
Parameters:
file - The file to write to.

setStdout

public void setStdout(OutputStream defaultOutputStream)
Description copied from interface: ResultFormatter
If you want to write to stdout, you can't just use System.out, because we're in the middle of ant task. Ensure that a suitable form is passed down instead.

Specified by:
setStdout in interface ResultFormatter


Copyright © 2007-2012. All Rights Reserved.