org.sonar.api.resources
Class Method

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

public class Method
extends Resource

See Also:
Serialized Form

Field Summary
protected  Language language
           
protected  String qualifier
           
static String SCOPE
           
 
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_SUBVIEW, QUALIFIER_UNIT_TEST_CLASS, QUALIFIER_VIEW, SCOPE_ENTITY, SCOPE_SET, SCOPE_SPACE
 
Constructor Summary
protected Method(String key, String qualifier, Language language)
           
 
Method Summary
static Method createMethod(String key, Language language)
           
 boolean equals(Object o)
           
 String getDescription()
           
 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()
          The qualifier tells the type of the resource.
 String getScope()
           
 int hashCode()
           
 boolean matchFilePattern(String antPattern)
          Check resource against an Ant pattern, like mypackag?/*Foo.java.
 
Methods inherited from class org.sonar.api.resources.Resource
getEffectiveKey, getId, getKey, isExcluded, setEffectiveKey, setExcluded, setId, setKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCOPE

public static final String SCOPE
See Also:
Constant Field Values

qualifier

protected String qualifier

language

protected Language language
Constructor Detail

Method

protected Method(String key,
                 String qualifier,
                 Language language)
Method Detail

getName

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

getLongName

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

getDescription

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

getLanguage

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

getScope

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

getQualifier

public final String getQualifier()
Description copied from class: Resource
The qualifier tells the type of the resource. For example, it can be a File, a Class, a Project, a Unit Test...

Specified by:
getQualifier in class Resource
Returns:
the qualifier
See Also:
for the list of qualifiers, to find out if a resource if a class, a unit test,... from its 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 final boolean matchFilePattern(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

equals

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

hashCode

public final int hashCode()
Overrides:
hashCode in class Resource

createMethod

public static Method createMethod(String key,
                                  Language language)


Copyright © 2009-2014 SonarSource. All Rights Reserved.