org.sonar.api.resources
Class Project

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

public class Project
extends Object
implements Resource

Since:
1.10

Nested Class Summary
static class Project.AnalysisType
           
 
Field Summary
static String PARAM_BRANCH
          Deprecated. since version 1.11. Constant moved to CoreProperties
static String PARAM_DATE
          Deprecated. since version 1.11. Constant moved to CoreProperties
static String PARAM_DEPRECATED_BRANCH
          Deprecated. since version 1.11. Constant moved to CoreProperties
static String PARAM_DYNAMIC_ANALYSIS
          Deprecated. since version 1.11. Constant moved to CoreProperties
static String PARAM_EXCLUSIONS
          Deprecated. since version 1.11. Constant moved to CoreProperties
static String PARAM_LANGUAGE
          Deprecated. since version 1.11. Constant moved to CoreProperties
static String PARAM_REUSE_RULES_CONFIG
          Deprecated. since version 1.11. Constant moved to CoreProperties
static String PARAM_VERSION
          Deprecated. since version 1.11. Constant moved to CoreProperties
 
Fields inherited from interface org.sonar.api.resources.Resource
QUALIFIER_CLASS, QUALIFIER_DIRECTORY, QUALIFIER_FILE, QUALIFIER_MODULE, QUALIFIER_PACKAGE, QUALIFIER_PROJECT, QUALIFIER_PROJECT_BRANCH, QUALIFIER_PROJECT_TRUNK, QUALIFIER_SUBVIEW, QUALIFIER_UNIT_TEST_CLASS, QUALIFIER_VIEW, SCOPE_DIRECTORY, SCOPE_ENTITY, SCOPE_FILE, SCOPE_PROJECT, SCOPE_SET, SCOPE_SPACE
 
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(Object o)
           
 Date getAnalysisDate()
           
 Project.AnalysisType getAnalysisType()
           
 String getAnalysisVersion()
           
 String getArtifactId()
           
 String getBranch()
           
 org.apache.commons.configuration.Configuration getConfiguration()
           
 String getDescription()
           
 String[] getExclusionPatterns()
          Patterns of resource exclusion as defined in project settings page.
 ProjectFileSystem getFileSystem()
           
 String getGroupId()
           
 Integer getId()
           
 String getKey()
          Project key is "groupId:artifactId[:branch]".
 Language getLanguage()
           
 String getLanguageKey()
           
 List<Project> getModules()
           
 String getName()
           
 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()
           
 Object getProperty(String key)
           
 String getQualifier()
           
 boolean getReuseExistingRulesConfig()
           
 Project getRoot()
           
 String getScope()
           
 Snapshot getSnapshot()
           
 int hashCode()
           
 boolean isModule()
           
 boolean isRoot()
           
 boolean isSonarLightMode()
          Deprecated. 
 boolean matchFilePattern(String antPattern)
          Check resource against an Ant pattern, like mypackag?/*Foo.java.
 Project setConfiguration(org.apache.commons.configuration.Configuration configuration)
           
 Project setDatabaseSettings(Integer projectId, Snapshot snapshot)
           
 void setExclusionPatterns(String[] patterns)
          Set exclusion patterns.
 Project setLanguages(Languages languages)
           
 void setParent(Project parent)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAM_DEPRECATED_BRANCH

@Deprecated
public static final String PARAM_DEPRECATED_BRANCH
Deprecated. since version 1.11. Constant moved to CoreProperties
See Also:
Constant Field Values

PARAM_BRANCH

@Deprecated
public static final String PARAM_BRANCH
Deprecated. since version 1.11. Constant moved to CoreProperties
See Also:
Constant Field Values

PARAM_VERSION

@Deprecated
public static final String PARAM_VERSION
Deprecated. since version 1.11. Constant moved to CoreProperties
See Also:
Constant Field Values

PARAM_DATE

@Deprecated
public static final String PARAM_DATE
Deprecated. since version 1.11. Constant moved to CoreProperties
See Also:
Constant Field Values

PARAM_LANGUAGE

@Deprecated
public static final String PARAM_LANGUAGE
Deprecated. since version 1.11. Constant moved to CoreProperties
See Also:
Constant Field Values

PARAM_DYNAMIC_ANALYSIS

@Deprecated
public static final String PARAM_DYNAMIC_ANALYSIS
Deprecated. since version 1.11. Constant moved to CoreProperties
See Also:
Constant Field Values

PARAM_EXCLUSIONS

@Deprecated
public static final String PARAM_EXCLUSIONS
Deprecated. since version 1.11. Constant moved to CoreProperties
See Also:
Constant Field Values

PARAM_REUSE_RULES_CONFIG

@Deprecated
public static final String PARAM_REUSE_RULES_CONFIG
Deprecated. since version 1.11. Constant moved to CoreProperties
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 Integer getId()

setDatabaseSettings

public Project setDatabaseSettings(Integer projectId,
                                   Snapshot snapshot)

setLanguages

public Project setLanguages(Languages languages)

getRoot

public Project getRoot()

getPackaging

public String getPackaging()

isRoot

public boolean isRoot()

isModule

public boolean isModule()

getAnalysisType

public Project.AnalysisType getAnalysisType()

getGroupId

public String getGroupId()

getArtifactId

public String getArtifactId()

getBranch

public String getBranch()

getName

public String getName()
Specified by:
getName in interface Resource

getDescription

public String getDescription()
Specified by:
getDescription in interface Resource

getLanguage

public Language getLanguage()
Specified by:
getLanguage in interface Resource

getLanguageKey

public String getLanguageKey()

getScope

public String getScope()
Specified by:
getScope in interface Resource

getQualifier

public String getQualifier()
Specified by:
getQualifier in interface Resource

matchFilePattern

public boolean matchFilePattern(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 List<Project> getModules()

getReuseExistingRulesConfig

public boolean getReuseExistingRulesConfig()

getAnalysisVersion

public String getAnalysisVersion()

getAnalysisDate

public Date getAnalysisDate()

getKey

public 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 String[] getExclusionPatterns()
Patterns of resource exclusion as defined in project settings page.


setExclusionPatterns

public void setExclusionPatterns(String[] patterns)
Set exclusion patterns. Configuration is not saved, so this method must be used ONLY IN UNIT TESTS.


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 Object getProperty(String key)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 SonarSource SA. All Rights Reserved.