Class CheckstyleAntTask.Formatter
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask.Formatter
-
- Enclosing class:
- CheckstyleAntTask
public static class CheckstyleAntTask.Formatter extends java.lang.Object
Details about a formatter to be used.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.FiletoFileThe file to output to.private CheckstyleAntTask.FormatterTypetypeThe formatter type.private booleanuseFileWhether or not the write to the named file.
-
Constructor Summary
Constructors Constructor Description Formatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private AuditListenercreateDefaultLogger(org.apache.tools.ant.Task task)Creates default logger.AuditListenercreateListener(org.apache.tools.ant.Task task)Creates a listener for the formatter.private AuditListenercreateXmlLogger(org.apache.tools.ant.Task task)Creates XML logger.voidsetTofile(java.io.File destination)Set the file to output to.voidsetType(CheckstyleAntTask.FormatterType type)Set the type of the formatter.voidsetUseFile(boolean use)Sets whether or not we write to a file if it is provided.
-
-
-
Field Detail
-
type
private CheckstyleAntTask.FormatterType type
The formatter type.
-
toFile
private java.io.File toFile
The file to output to.
-
useFile
private boolean useFile
Whether or not the write to the named file.
-
-
Constructor Detail
-
Formatter
public Formatter()
-
-
Method Detail
-
setType
public void setType(CheckstyleAntTask.FormatterType type)
Set the type of the formatter.- Parameters:
type- the type
-
setTofile
public void setTofile(java.io.File destination)
Set the file to output to.- Parameters:
destination- destination the file to output to
-
setUseFile
public void setUseFile(boolean use)
Sets whether or not we write to a file if it is provided.- Parameters:
use- whether not not to use provided file.
-
createListener
public AuditListener createListener(org.apache.tools.ant.Task task) throws java.io.IOException
Creates a listener for the formatter.- Parameters:
task- the task running- Returns:
- a listener
- Throws:
java.io.IOException- if an error occurs
-
createDefaultLogger
private AuditListener createDefaultLogger(org.apache.tools.ant.Task task) throws java.io.IOException
Creates default logger.- Parameters:
task- the task to possibly log to- Returns:
- a DefaultLogger instance
- Throws:
java.io.IOException- if an error occurs
-
createXmlLogger
private AuditListener createXmlLogger(org.apache.tools.ant.Task task) throws java.io.IOException
Creates XML logger.- Parameters:
task- the task to possibly log to- Returns:
- an XMLLogger instance
- Throws:
java.io.IOException- if an error occurs
-
-