org.sonar.api.resources
Class Directory

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

public class Directory
extends Object
implements Resource

Since:
1.10

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

Field Detail

SEPARATOR

public static final String SEPARATOR
See Also:
Constant Field Values

ROOT

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

Directory

public Directory(String key)

Directory

public Directory(String key,
                 Language language)
Method Detail

getKey

public String getKey()
Specified by:
getKey in interface Resource
Returns:
the resource key

getName

public String getName()
Specified by:
getName in interface Resource
Returns:
the resource name

getLongName

public String getLongName()
Specified by:
getLongName in interface Resource
Returns:
the resource long name

getDescription

public String getDescription()
Specified by:
getDescription in interface Resource
Returns:
the resource description

getLanguage

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

getScope

public String getScope()
Specified by:
getScope in interface Resource
Returns:
the scope

getQualifier

public String getQualifier()
Specified by:
getQualifier in interface Resource
Returns:
the qualifier

getParent

public Resource 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

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

parseKey

public static String parseKey(String key)

equals

public boolean equals(Object obj)
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.