org.sonar.api.resources
Interface Resource<PARENT extends Resource>

All Known Implementing Classes:
AbstractResource, Directory, File, JavaFile, JavaPackage, Project

public interface Resource<PARENT extends Resource>

The interface to implement to create a resource in Sonar

Since:
1.10

Field Summary
static String QUALIFIER_CLASS
           
static String QUALIFIER_DIRECTORY
           
static String QUALIFIER_FILE
           
static String QUALIFIER_MODULE
           
static String QUALIFIER_PACKAGE
           
static String QUALIFIER_PROJECT
           
static String QUALIFIER_PROJECT_BRANCH
          Deprecated. 
static String QUALIFIER_PROJECT_TRUNK
          Deprecated. 
static String QUALIFIER_SUBVIEW
           
static String QUALIFIER_UNIT_TEST_CLASS
           
static String QUALIFIER_VIEW
           
static String SCOPE_DIRECTORY
          Deprecated. 
static String SCOPE_ENTITY
           
static String SCOPE_FILE
          Deprecated. 
static String SCOPE_PROJECT
          Deprecated. 
static String SCOPE_SET
           
static String SCOPE_SPACE
           
 
Method Summary
 String getDescription()
           
 String getKey()
           
 Language getLanguage()
           
 String getLongName()
           
 String getName()
           
 PARENT getParent()
          The parent is used to build the resources tree, for example for relations between classes, packages and projects.
 String getQualifier()
           
 String getScope()
           
 boolean matchFilePattern(String antPattern)
          Check resource against an Ant pattern, like mypackag?/*Foo.java.
 

Field Detail

SCOPE_SET

static final String SCOPE_SET
See Also:
Constant Field Values

SCOPE_SPACE

static final String SCOPE_SPACE
See Also:
Constant Field Values

SCOPE_ENTITY

static final String SCOPE_ENTITY
See Also:
Constant Field Values

SCOPE_PROJECT

@Deprecated
static final String SCOPE_PROJECT
Deprecated. 
Use SCOPE_SET instead

See Also:
Constant Field Values

SCOPE_DIRECTORY

@Deprecated
static final String SCOPE_DIRECTORY
Deprecated. 
Use SCOPE_SPACE instead

See Also:
Constant Field Values

SCOPE_FILE

@Deprecated
static final String SCOPE_FILE
Deprecated. 
Use SCOPE_ENTITY instead

See Also:
Constant Field Values

QUALIFIER_VIEW

static final String QUALIFIER_VIEW
See Also:
Constant Field Values

QUALIFIER_SUBVIEW

static final String QUALIFIER_SUBVIEW
See Also:
Constant Field Values

QUALIFIER_PROJECT

static final String QUALIFIER_PROJECT
See Also:
Constant Field Values

QUALIFIER_MODULE

static final String QUALIFIER_MODULE
See Also:
Constant Field Values

QUALIFIER_PACKAGE

static final String QUALIFIER_PACKAGE
See Also:
Constant Field Values

QUALIFIER_DIRECTORY

static final String QUALIFIER_DIRECTORY
See Also:
Constant Field Values

QUALIFIER_FILE

static final String QUALIFIER_FILE
See Also:
Constant Field Values

QUALIFIER_CLASS

static final String QUALIFIER_CLASS
See Also:
Constant Field Values

QUALIFIER_UNIT_TEST_CLASS

static final String QUALIFIER_UNIT_TEST_CLASS
See Also:
Constant Field Values

QUALIFIER_PROJECT_TRUNK

@Deprecated
static final String QUALIFIER_PROJECT_TRUNK
Deprecated. 
Use QUALIFIER_PROJECT instead

See Also:
Constant Field Values

QUALIFIER_PROJECT_BRANCH

@Deprecated
static final String QUALIFIER_PROJECT_BRANCH
Deprecated. 
Use QUALIFIER_MODULE instead

See Also:
Constant Field Values
Method Detail

getKey

String getKey()
Returns:
the resource key

getName

String getName()
Returns:
the resource name

getLongName

String getLongName()
Returns:
the resource long name

getDescription

String getDescription()
Returns:
the resource description

getLanguage

Language getLanguage()
Returns:
the language

getScope

String getScope()
Returns:
the scope

getQualifier

String getQualifier()
Returns:
the qualifier

getParent

PARENT getParent()
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.


matchFilePattern

boolean matchFilePattern(String antPattern)
Check resource against an Ant pattern, like mypackag?/*Foo.java. It's used for example to match resource exclusions.

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


Copyright © 2009 SonarSource SA. All Rights Reserved.