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


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_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.lang.String getBranch()
           
 org.apache.commons.configuration.Configuration getConfiguration()
           
 java.lang.String getDescription()
           
 java.lang.String[] getExclusionPatterns()
          Patterns of resource exclusion as defined in project settings page.
 ProjectFileSystem getFileSystem()
           
 java.lang.String getGroupId()
           
 java.lang.Integer getId()
           
 java.lang.String getKey()
          Project key is "groupId:artifactId[:branch]".
 Language getLanguage()
           
 java.lang.String getLanguageKey()
           
 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.
 org.apache.maven.project.MavenProject getPom()
           
 java.lang.Object getProperty(java.lang.String key)
           
 java.lang.String getQualifier()
           
 Project getRoot()
           
 java.lang.String getScope()
           
 Snapshot getSnapshot()
           
 int hashCode()
           
 boolean isModule()
           
 boolean isRoot()
           
 boolean isSonarLightMode()
          Deprecated. 
 boolean matchFilePattern(java.lang.String antPattern)
          Check resource against an Ant pattern, like mypackag?/*Foo.java.
 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 Language getLanguage()
Specified by:
getLanguage in interface Resource

getLanguageKey

public java.lang.String getLanguageKey()

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()
Project key is "groupId:artifactId[:branch]". Examples : org.struts:struts-core and org.codehaus.sonar:sonar:1.10

Specified by:
getKey in interface Resource

getExclusionPatterns

public java.lang.String[] getExclusionPatterns()
Patterns of resource exclusion as defined in project settings page.


getFileSystem

public ProjectFileSystem getFileSystem()

getPom

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

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.