org.sonar.api.resources
Class Directory

java.lang.Object
  extended by org.sonar.api.resources.Resource
      extended by org.sonar.api.resources.Directory

public class Directory
extends Resource

Since:
1.10

Field Summary
static java.lang.String ROOT
           
static java.lang.String SEPARATOR
           
 
Fields inherited from class org.sonar.api.resources.Resource
QUALIFIER_CLASS, QUALIFIER_DIRECTORY, QUALIFIER_FIELD, QUALIFIER_FILE, QUALIFIER_LIB, QUALIFIER_METHOD, 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
Directory(java.lang.String key)
           
Directory(java.lang.String key, Language language)
           
 
Method Summary
 java.lang.String getDescription()
           
 Language getLanguage()
           
 java.lang.String getLongName()
           
 java.lang.String getName()
           
 Resource getParent()
          The parent is used to build the resources tree, for example for relations between classes, packages and projects.
 java.lang.String getQualifier()
           
 java.lang.String getScope()
           
 boolean matchFilePattern(java.lang.String antPattern)
          Check resource against an Ant pattern, like mypackag?/*Foo.java.
static java.lang.String parseKey(java.lang.String key)
           
 java.lang.String toString()
           
 
Methods inherited from class org.sonar.api.resources.Resource
equals, getEffectiveKey, getId, getKey, hashCode, isExcluded, setEffectiveKey, setExcluded, setId, setKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR

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

ROOT

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

Directory

public Directory(java.lang.String key)

Directory

public Directory(java.lang.String key,
                 Language language)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class Resource
Returns:
the resource name

getLongName

public java.lang.String getLongName()
Specified by:
getLongName in class Resource
Returns:
the resource long name

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in class Resource
Returns:
the resource description

getLanguage

public Language getLanguage()
Specified by:
getLanguage in class Resource
Returns:
the language

getScope

public java.lang.String getScope()
Specified by:
getScope in class Resource
Returns:
the scope

getQualifier

public java.lang.String getQualifier()
Specified by:
getQualifier in class Resource
Returns:
the qualifier

getParent

public Resource getParent()
Description copied from class: 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 class Resource

matchFilePattern

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

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

parseKey

public static java.lang.String parseKey(java.lang.String key)

toString

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


Copyright © 2009-2010 SonarSource. All Rights Reserved.