hudson.plugins.dry.parser
Class AbstractDryParser
java.lang.Object
hudson.plugins.dry.parser.AbstractDryParser
- All Implemented Interfaces:
- hudson.plugins.analysis.core.AnnotationParser, java.io.Serializable
- Direct Known Subclasses:
- CpdParser
public abstract class AbstractDryParser
- extends java.lang.Object
- implements hudson.plugins.analysis.core.AnnotationParser
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.
- Author:
- Ulli Hafner
- See Also:
- Serialized Form
|
Method Summary |
protected abstract boolean |
accepts(java.io.InputStream inputStream)
Returns whether this parser accepts the specified stream as a valid
file. |
java.util.Collection<hudson.plugins.analysis.util.model.FileAnnotation> |
parse(java.io.File file,
java.lang.String moduleName)
|
protected abstract java.util.Collection<hudson.plugins.analysis.util.model.FileAnnotation> |
parse(java.io.InputStream inputStream,
java.lang.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 |
AbstractDryParser
public AbstractDryParser()
parse
public java.util.Collection<hudson.plugins.analysis.util.model.FileAnnotation> parse(java.io.File file,
java.lang.String moduleName)
throws java.lang.reflect.InvocationTargetException
-
- Specified by:
parse in interface hudson.plugins.analysis.core.AnnotationParser
- Throws:
java.lang.reflect.InvocationTargetException
parse
protected abstract java.util.Collection<hudson.plugins.analysis.util.model.FileAnnotation> parse(java.io.InputStream inputStream,
java.lang.String moduleName)
throws java.lang.reflect.InvocationTargetException
- Returns the duplication annotations found in the specified file.
- Parameters:
inputStream - the file to parsemoduleName - name of the maven module
- Returns:
- the parsed annotations
- Throws:
java.lang.reflect.InvocationTargetException - if the file could not be parsed (wrap your actual exception in this exception)
accepts
protected abstract boolean accepts(java.io.InputStream inputStream)
- Returns whether this parser accepts the specified stream as a valid
file.
- Parameters:
inputStream - the file to parse
- Returns:
true if this parser accepts the specified stream as
a valid file, false if the parser can't read this file
Copyright © 2009. All Rights Reserved.