|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.plugins.dry.parser.AbstractDryParser
public abstract class AbstractDryParser
A base class for duplicate code parsers. Use this class as a starting point
for your duplication result parser and register an instance in the
DuplicationParserRegistry.
| Constructor Summary | |
|---|---|
AbstractDryParser(int highThreshold,
int normalThreshold)
Creates a new instance of AbstractDryParser. |
|
| Method Summary | |
|---|---|
protected abstract boolean |
accepts(InputStream inputStream)
Returns whether this parser accepts the specified stream as a valid file. |
protected hudson.plugins.analysis.util.model.Priority |
getPriority(int lines)
Returns the priority of the warning. |
Collection<hudson.plugins.analysis.util.model.FileAnnotation> |
parse(File file,
String moduleName)
|
protected abstract Collection<DuplicateCode> |
parse(InputStream inputStream,
String moduleName)
Returns the duplication annotations found in the specified file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractDryParser(int highThreshold,
int normalThreshold)
AbstractDryParser.
highThreshold - minimum number of duplicate lines for high priority warningsnormalThreshold - minimum number of duplicate lines for normal priority warnings| Method Detail |
|---|
public Collection<hudson.plugins.analysis.util.model.FileAnnotation> parse(File file,
String moduleName)
throws InvocationTargetException
parse in interface hudson.plugins.analysis.core.AnnotationParserInvocationTargetException
protected abstract Collection<DuplicateCode> parse(InputStream inputStream,
String moduleName)
throws InvocationTargetException
inputStream - the file to parsemoduleName - name of the maven module
InvocationTargetException - if the file could not be parsed (wrap your actual exception in this exception)protected abstract boolean accepts(InputStream inputStream)
inputStream - the file to parse
true if this parser accepts the specified stream as
a valid file, false if the parser can't read this fileprotected hudson.plugins.analysis.util.model.Priority getPriority(int lines)
lines - number of duplicate lines
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||