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.
 void addModules(java.util.Collection<MavenModule> modules)
          Adds the specified modules with their annotations to this project.
protected  void annotationAdded(FileAnnotation annotation)
          Creates the mapping of modules.
 boolean containsModule(java.lang.String moduleName)
          Returns whether the maven module with the given name exists.
 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)
          Gets the file with the given name.
 java.util.Collection<WorkspaceFile> getFiles()
          Gets the files of this container 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, addFile, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getName, getNumberOfAnnotations, getNumberOfAnnotations, getNumberOfAnnotations, getPackageCategoryName, getToolTip, hasAnnotations, hasAnnotations, hasAnnotations, rebuildMappings, setName
 
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

containsModule

public boolean containsModule(java.lang.String moduleName)
Returns whether the maven module with the given name exists.

Parameters:
moduleName - the module to check for
Returns:
true if the maven module with the given name exists, false otherwise

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
See Also:
containsModule(String)

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 container that have annotations.

Overrides:
getFiles in class AnnotationContainer
Returns:
the files with annotations

getFile

public WorkspaceFile getFile(java.lang.String name)
Gets the file with the given name.

Overrides:
getFile in class AnnotationContainer
Parameters:
name - the short name of the file
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

addModules

public void addModules(java.util.Collection<MavenModule> modules)
Adds the specified modules with their annotations to this project.

Parameters:
modules - the modules 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.