hudson.plugins.analysis.core
Class ParserResult

java.lang.Object
  extended by hudson.plugins.analysis.core.ParserResult
All Implemented Interfaces:
Serializable

public class ParserResult
extends Object
implements Serializable

Stores the collection of parsed annotations and associated error messages. This class is not thread safe.

Author:
Ulli Hafner
See Also:
Serialized Form

Constructor Summary
ParserResult()
          Creates a new instance of ParserResult.
ParserResult(Collection<? extends FileAnnotation> annotations)
          Creates a new instance of ParserResult.
ParserResult(hudson.FilePath workspace)
          Creates a new instance of ParserResult.
ParserResult(hudson.plugins.analysis.core.ParserResult.Workspace workspace)
          Creates a new instance of ParserResult.
 
Method Summary
 void addAnnotation(FileAnnotation annotation)
          Adds the specified annotation to this container.
 void addAnnotations(Collection<? extends FileAnnotation> newAnnotations)
          Adds the specified annotations to this container.
 void addAnnotations(FileAnnotation[] newAnnotations)
          Adds the specified annotations to this container.
 void addErrorMessage(String message)
          Adds an error message.
 void addErrorMessage(String module, String message)
          Adds an error message for the specified module name.
 void addErrors(List<String> errors)
          Adds the error messages to this result.
 void addModule(String moduleName)
          Adds a new parsed module.
 void addModules(Collection<String> additionalModules)
          Adds the specified parsed modules.
 void addProject(ParserResult additionalProject)
          Adds the warnings of the specified project to this project.
 Set<FileAnnotation> getAnnotations()
          Returns the annotations of this result.
 List<String> getErrorMessages()
          Returns the errorMessages.
 String getLogMessages()
          Returns the log messages of the parsing process.
 Set<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.
 void setLog(String message)
          Sets the log messages of the parsing process.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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

ParserResult

public ParserResult(hudson.plugins.analysis.core.ParserResult.Workspace workspace)
Creates a new instance of ParserResult.

Parameters:
workspace - the workspace to find the files in

ParserResult

public ParserResult(Collection<? extends FileAnnotation> annotations)
Creates a new instance of ParserResult.

Parameters:
annotations - the annotations to add
Method Detail

addProject

public void addProject(ParserResult additionalProject)
Adds the warnings of the specified project to this project.

Parameters:
additionalProject - the project to add

addAnnotation

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

Parameters:
annotation - the annotation to add

addAnnotations

public final void addAnnotations(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(String module,
                            String message)
Adds an error message for the specified module name.

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

addErrorMessage

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

Parameters:
message - the error message

addErrors

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

Parameters:
errors - the error messages to add

getErrorMessages

public List<String> getErrorMessages()
Returns the errorMessages.

Returns:
the errorMessages

getAnnotations

public Set<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 Set<String> getModules()
Returns the parsed modules.

Returns:
the parsed modules

addModule

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

Parameters:
moduleName - the name of the parsed module

addModules

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

Parameters:
additionalModules - the name of the parsed modules

toString

public String toString()
Overrides:
toString in class Object

setLog

public void setLog(String message)
Sets the log messages of the parsing process.

Parameters:
message - a multiline message
Since:
1.20

getLogMessages

public String getLogMessages()
Returns the log messages of the parsing process.

Returns:
the messages
Since:
1.20


Copyright © 2004-2012 Hudson. All Rights Reserved.