hudson.plugins.pmd.util.model
Class JavaProject

java.lang.Object
  extended by hudson.plugins.pmd.util.model.AnnotationContainer
      extended by hudson.plugins.pmd.util.model.JavaProject
All Implemented Interfaces:
AnnotationProvider, java.io.Serializable

public class JavaProject
extends AnnotationContainer

A serializable Java Bean class representing a project that has been built by Hudson.

Author:
Ulli Hafner
See Also:
Serialized Form

Constructor Summary
JavaProject()
           
 
Method Summary
 void addFiles(java.util.Collection<WorkspaceFile> files)
          Adds the specified annotations of the given files to this container.
 void addModule(MavenModule module)
          Adds the specified module with its annotations to this project.
protected  void annotationAdded(FileAnnotation annotation)
          Creates the mapping of modules.
 int getAnnotationBound()
          Gets the maximum number of tasks in a module.
 java.lang.String getError()
          Returns the error message that denotes that why project creation has been failed.
 WorkspaceFile getFile(java.lang.String name)
          Returns the file with the given name.
 java.util.Collection<WorkspaceFile> getFiles()
          Gets the files of this project that have annotations.
 MavenModule getModule(java.lang.String moduleName)
          Returns the maven module with the given name.
 java.util.Collection<MavenModule> getModules()
          Gets the modules of this project that have annotations.
 JavaPackage getPackage(java.lang.String name)
          Returns the package with the given name.
 java.util.Collection<JavaPackage> getPackages()
          Gets the packages of this project that have annotations.
 java.lang.String getWorkspacePath()
          Returns the root path of the workspace files.
 boolean hasError()
          Returns whether a module with an error is part of this project.
 void setError(java.lang.String error)
          Sets the error message that denotes that why project creation has been failed.
 void setWorkspacePath(java.lang.String workspacePath)
          Sets the root path of the workspace files.
 
Methods inherited from class hudson.plugins.pmd.util.model.AnnotationContainer
addAnnotation, addAnnotations, addAnnotations, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getNumberOfAnnotations, getNumberOfAnnotations, getNumberOfAnnotations, getToolTip, hasAnnotations, hasAnnotations, hasAnnotations, rebuildPriorities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaProject

public JavaProject()
Method Detail

addFiles

public void addFiles(java.util.Collection<WorkspaceFile> files)
Adds the specified annotations of the given files to this container.

Parameters:
files - the files to get the annotations from

annotationAdded

protected void annotationAdded(FileAnnotation annotation)
Creates the mapping of modules.

Overrides:
annotationAdded in class AnnotationContainer
Parameters:
annotation - the added annotation

getModules

public java.util.Collection<MavenModule> getModules()
Gets the modules of this project that have annotations.

Returns:
the modules with annotations

getModule

public MavenModule getModule(java.lang.String moduleName)
Returns the maven module with the given name.

Parameters:
moduleName - the module to get
Returns:
the module with the given name

getPackages

public java.util.Collection<JavaPackage> getPackages()
Gets the packages of this project that have annotations.

Returns:
the packages with annotations

getPackage

public JavaPackage getPackage(java.lang.String name)
Returns the package with the given name. This method is only valid for single module projects.

Parameters:
name - the package name
Returns:
the package with the given name.

getFiles

public java.util.Collection<WorkspaceFile> getFiles()
Gets the files of this project that have annotations.

Returns:
the files with annotations

getFile

public WorkspaceFile getFile(java.lang.String name)
Returns the file with the given name. This method is only valid for single module projects.

Parameters:
name - the file name
Returns:
the file with the given name.

setWorkspacePath

public void setWorkspacePath(java.lang.String workspacePath)
Sets the root path of the workspace files.

Parameters:
workspacePath - path to workspace

getWorkspacePath

public java.lang.String getWorkspacePath()
Returns the root path of the workspace files.

Returns:
the workspace path

getAnnotationBound

public int getAnnotationBound()
Gets the maximum number of tasks in a module.

Returns:
the maximum number of tasks

addModule

public void addModule(MavenModule module)
Adds the specified module with its annotations to this project.

Parameters:
module - the module to add

hasError

public boolean hasError()
Returns whether a module with an error is part of this project.

Returns:
true if at least one module has an error.

setError

public void setError(java.lang.String error)
Sets the error message that denotes that why project creation has been failed.

Parameters:
error - the new error message

getError

public java.lang.String getError()
Returns the error message that denotes that why project creation has been failed.

Returns:
the error message that denotes that why project creation has been failed.


Copyright © 2008. All Rights Reserved.