org.sonar.api.resources
Class Project

java.lang.Object
  extended by org.sonar.api.resources.Project
All Implemented Interfaces:
Resource

public class Project
extends java.lang.Object
implements Resource

See Also:
for utility methods.

Nested Class Summary
static class Project.AnalysisType
           
 
Field Summary
static java.lang.String PARAM_BRANCH
           
static java.lang.String PARAM_DATE
           
static java.lang.String PARAM_DEPRECATED_BRANCH
           
static java.lang.String PARAM_DYNAMIC_ANALYSIS
           
static java.lang.String PARAM_EXCLUSIONS
           
static java.lang.String PARAM_LANGUAGE
           
static java.lang.String PARAM_VERSION
           
 
Fields inherited from interface org.sonar.api.resources.Resource
QUALIFIER_CLASS, QUALIFIER_DIRECTORY, QUALIFIER_FILE, QUALIFIER_PACKAGE, QUALIFIER_PROJECT_BRANCH, QUALIFIER_PROJECT_TRUNK, QUALIFIER_UNIT_TEST_CLASS, SCOPE_DIRECTORY, SCOPE_FILE, SCOPE_FUNCTION, SCOPE_PROJECT
 
Constructor Summary
Project(org.apache.maven.project.MavenProject mavenProject)
           
Project(org.apache.maven.project.MavenProject pom, org.apache.commons.configuration.Configuration configuration)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.util.Date getAnalysisDate()
           
 Project.AnalysisType getAnalysisType()
           
 java.lang.String getAnalysisVersion()
           
 java.lang.String getArtifactId()
           
 java.io.File getBasedir()
           
 java.lang.String getBranch()
           
 java.io.File getBuildDir()
           
 java.io.File getBuildOutputDir()
           
 org.apache.commons.configuration.Configuration getConfiguration()
           
 java.lang.String getDescription()
           
 java.lang.String[] getExclusionPatterns()
           
 java.lang.String getGroupId()
           
 java.lang.Integer getId()
           
 java.lang.String getKey()
           
 java.lang.String getLanguage()
           
 org.apache.maven.project.MavenProject getMavenProject()
           
 java.util.List<Project> getModules()
           
 java.lang.String getName()
           
 java.lang.String getPackaging()
           
 Project getParent()
          The parent is used to build the resources tree, for example for relations between classes, packages and projects.
 java.lang.Object getProperty(java.lang.String key)
           
 java.lang.String getQualifier()
           
 java.io.File getReportOutputDir()
           
 Project getRoot()
           
 java.lang.String getScope()
           
 Snapshot getSnapshot()
           
 java.io.File getSonarWorkingDirectory()
           
 java.nio.charset.Charset getSourceCharset()
           
 java.util.List<java.io.File> getSourceDirs()
           
 java.util.List<java.io.File> getSourceFiles(java.lang.String... languageKeys)
           
 java.util.Collection<java.io.File> getTestFiles(Language lang)
           
 java.util.List<java.io.File> getUnitTestDirs()
           
 java.util.List<java.io.File> getUnitTestFiles(java.lang.String... languageKeys)
           
 int hashCode()
           
 boolean hasTests(Language lang)
           
 boolean isModule()
           
 boolean isRoot()
           
 boolean isSonarLightMode()
          Deprecated. 
 boolean matchFilePattern(java.lang.String antPattern)
          Check resource against an Ant pattern, like mypackag?/*Foo.java.
 java.io.File resolvePath(java.lang.String path)
           
 Project setConfiguration(org.apache.commons.configuration.Configuration configuration)
           
 Project setDatabaseSettings(java.lang.Integer projectId, Snapshot snapshot)
           
 Project setLanguages(Languages languages)
           
 void setParent(Project parent)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAM_DEPRECATED_BRANCH

public static final java.lang.String PARAM_DEPRECATED_BRANCH
See Also:
Constant Field Values

PARAM_BRANCH

public static final java.lang.String PARAM_BRANCH
See Also:
Constant Field Values

PARAM_VERSION

public static final java.lang.String PARAM_VERSION
See Also:
Constant Field Values

PARAM_DATE

public static final java.lang.String PARAM_DATE
See Also:
Constant Field Values

PARAM_LANGUAGE

public static final java.lang.String PARAM_LANGUAGE
See Also:
Constant Field Values

PARAM_DYNAMIC_ANALYSIS

public static final java.lang.String PARAM_DYNAMIC_ANALYSIS
See Also:
Constant Field Values

PARAM_EXCLUSIONS

public static final java.lang.String PARAM_EXCLUSIONS
See Also:
Constant Field Values
Constructor Detail

Project

public Project(org.apache.maven.project.MavenProject mavenProject)

Project

public Project(org.apache.maven.project.MavenProject pom,
               org.apache.commons.configuration.Configuration configuration)
Method Detail

getSnapshot

public Snapshot getSnapshot()

getId

public java.lang.Integer getId()

setDatabaseSettings

public Project setDatabaseSettings(java.lang.Integer projectId,
                                   Snapshot snapshot)

setLanguages

public Project setLanguages(Languages languages)

getRoot

public Project getRoot()

getPackaging

public java.lang.String getPackaging()

isRoot

public boolean isRoot()

isModule

public boolean isModule()

getAnalysisType

public Project.AnalysisType getAnalysisType()

getGroupId

public java.lang.String getGroupId()

getArtifactId

public java.lang.String getArtifactId()

getBranch

public java.lang.String getBranch()

getName

public java.lang.String getName()
Specified by:
getName in interface Resource

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface Resource

getLanguage

public java.lang.String getLanguage()
Specified by:
getLanguage in interface Resource

getScope

public java.lang.String getScope()
Specified by:
getScope in interface Resource

getQualifier

public java.lang.String getQualifier()
Specified by:
getQualifier in interface Resource

matchFilePattern

public boolean matchFilePattern(java.lang.String antPattern)
Description copied from interface: Resource
Check resource against an Ant pattern, like mypackag?/*Foo.java. It's used for example to match resource exclusions.

Specified by:
matchFilePattern in interface Resource
Parameters:
antPattern - Ant-like pattern (with **, * and ?). It includes file suffixes.
Returns:
true if the resource matches the Ant pattern

getParent

public Project getParent()
Description copied from interface: Resource
The parent is used to build the resources tree, for example for relations between classes, packages and projects.

Return null if the parent is the project.

Specified by:
getParent in interface Resource

setParent

public void setParent(Project parent)

getModules

public java.util.List<Project> getModules()

getAnalysisVersion

public java.lang.String getAnalysisVersion()

getAnalysisDate

public java.util.Date getAnalysisDate()

getKey

public java.lang.String getKey()
Specified by:
getKey in interface Resource

getExclusionPatterns

public java.lang.String[] getExclusionPatterns()

getSourceCharset

public java.nio.charset.Charset getSourceCharset()

getBasedir

public java.io.File getBasedir()

getBuildDir

public java.io.File getBuildDir()

getBuildOutputDir

public java.io.File getBuildOutputDir()

getSourceDirs

public java.util.List<java.io.File> getSourceDirs()

getUnitTestDirs

public java.util.List<java.io.File> getUnitTestDirs()

getReportOutputDir

public java.io.File getReportOutputDir()

getSonarWorkingDirectory

public java.io.File getSonarWorkingDirectory()

resolvePath

public java.io.File resolvePath(java.lang.String path)

getSourceFiles

public java.util.List<java.io.File> getSourceFiles(java.lang.String... languageKeys)

getUnitTestFiles

public java.util.List<java.io.File> getUnitTestFiles(java.lang.String... languageKeys)

getTestFiles

public java.util.Collection<java.io.File> getTestFiles(Language lang)

hasTests

public boolean hasTests(Language lang)

getMavenProject

public org.apache.maven.project.MavenProject getMavenProject()

isSonarLightMode

@Deprecated
public boolean isSonarLightMode()
Deprecated. 


getConfiguration

public org.apache.commons.configuration.Configuration getConfiguration()

setConfiguration

public Project setConfiguration(org.apache.commons.configuration.Configuration configuration)

getProperty

public java.lang.Object getProperty(java.lang.String key)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009 SonarSource SA. All Rights Reserved.