hudson.plugins.pmd.util
Class ParserResult

java.lang.Object
  extended by hudson.plugins.pmd.util.ParserResult
All Implemented Interfaces:
java.io.Serializable

public class ParserResult
extends java.lang.Object
implements java.io.Serializable

Stores the collection of parsed annotations and associated error messages.

Author:
Ulli Hafner
See Also:
Serialized Form

Constructor Summary
ParserResult()
          Creates a new instance of ParserResult.
ParserResult(hudson.FilePath workspace)
          Creates a new instance of ParserResult.
 
Method Summary
 void addAnnotation(FileAnnotation annotation)
          Adds the specified annotation to this container.
 void addAnnotations(java.util.Collection<? extends FileAnnotation> newAnnotations)
          Adds the specified annotations to this container.
 void addAnnotations(FileAnnotation[] newAnnotations)
          Adds the specified annotations to this container.
 void addErrorMessage(java.lang.String message)
          Adds an error message.
 void addErrorMessage(java.lang.String module, java.lang.String message)
          Addds an error message for the specified module name.
 void addErrors(java.util.List<java.lang.String> errors)
          Adds the error messages to this result.
 void addModule(java.lang.String moduleName)
          Adds a new parsed module.
 void addModules(java.util.Collection<java.lang.String> additionalModules)
          Adds the specified parsed modules.
 java.util.Collection<FileAnnotation> getAnnotations()
          Returns the annotations of this result.
 java.util.Collection<java.lang.String> getErrorMessages()
          Returns the errorMessages.
 java.util.Set<java.lang.String> getModules()
          Returns the parsed modules.
 int getNumberOfAnnotations()
          Returns the total number of annotations for this object.
 int getNumberOfAnnotations(Priority priority)
          Returns the total number of annotations of the specified priority for this object.
 int getNumberOfModules()
          Returns the number of modules.
 boolean hasAnnotations()
          Returns whether this objects has annotations.
 boolean hasAnnotations(Priority priority)
          Returns whether this objects has annotations with the specified priority.
 boolean hasNoAnnotations()
          Returns whether this objects has no annotations.
 boolean hasNoAnnotations(Priority priority)
          Returns whether this objects has no annotations with the specified priority.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserResult

public ParserResult()
Creates a new instance of ParserResult.


ParserResult

public ParserResult(hudson.FilePath workspace)
Creates a new instance of ParserResult.

Parameters:
workspace - the workspace to find the files in
Method Detail

addAnnotation

public void addAnnotation(FileAnnotation annotation)
Adds the specified annotation to this container.

Parameters:
annotation - the annotation to add

addAnnotations

public final void addAnnotations(java.util.Collection<? extends FileAnnotation> newAnnotations)
Adds the specified annotations to this container.

Parameters:
newAnnotations - the annotations to add

addAnnotations

public final void addAnnotations(FileAnnotation[] newAnnotations)
Adds the specified annotations to this container.

Parameters:
newAnnotations - the annotations to add

addErrorMessage

public void addErrorMessage(java.lang.String module,
                            java.lang.String message)
Addds an error message for the specified module name.

Parameters:
module - the current module
message - the error message

addErrorMessage

public void addErrorMessage(java.lang.String message)
Adds an error message.

Parameters:
message - the error message

addErrors

public void addErrors(java.util.List<java.lang.String> errors)
Adds the error messages to this result.

Parameters:
errors - the error messages to add

getErrorMessages

public java.util.Collection<java.lang.String> getErrorMessages()
Returns the errorMessages.

Returns:
the errorMessages

getAnnotations

public java.util.Collection<FileAnnotation> getAnnotations()
Returns the annotations of this result.

Returns:
the annotations of this result

getNumberOfAnnotations

public int getNumberOfAnnotations()
Returns the total number of annotations for this object.

Returns:
total number of annotations for this object

getNumberOfAnnotations

public int getNumberOfAnnotations(Priority priority)
Returns the total number of annotations of the specified priority for this object.

Parameters:
priority - the priority
Returns:
total number of annotations of the specified priority for this object

hasAnnotations

public boolean hasAnnotations()
Returns whether this objects has annotations.

Returns:
true if this objects has annotations.

hasAnnotations

public boolean hasAnnotations(Priority priority)
Returns whether this objects has annotations with the specified priority.

Parameters:
priority - the priority
Returns:
true if this objects has annotations.

hasNoAnnotations

public boolean hasNoAnnotations()
Returns whether this objects has no annotations.

Returns:
true if this objects has no annotations.

hasNoAnnotations

public boolean hasNoAnnotations(Priority priority)
Returns whether this objects has no annotations with the specified priority.

Parameters:
priority - the priority
Returns:
true if this objects has no annotations.

getNumberOfModules

public int getNumberOfModules()
Returns the number of modules.

Returns:
the number of modules

getModules

public java.util.Set<java.lang.String> getModules()
Returns the parsed modules.

Returns:
the parsed modules

addModule

public void addModule(java.lang.String moduleName)
Adds a new parsed module.

Parameters:
moduleName - the name of the parsed module

addModules

public void addModules(java.util.Collection<java.lang.String> additionalModules)
Adds the specified parsed modules.

Parameters:
additionalModules - the name of the parsed modules


Copyright © 2009. All Rights Reserved.