org.sonar.api.resources
Class AbstractResource<PARENT extends Resource>

java.lang.Object
  extended by org.sonar.api.resources.AbstractResource<PARENT>
All Implemented Interfaces:
Resource

public abstract class AbstractResource<PARENT extends Resource>
extends Object
implements Resource

Since:
1.10

Field Summary
 
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
protected AbstractResource()
           
protected AbstractResource(String scope, String qualifier)
           
protected AbstractResource(String key, String scope, String qualifier)
           
 
Method Summary
 boolean equals(Object obj)
           
 String getDescription()
          
 String getKey()
          
 Language getLanguage()
          
 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()
          
 int hashCode()
           
 Resource<? extends PARENT> setDescription(String description)
           
 Resource<? extends PARENT> setKey(String key)
           
 Resource<? extends PARENT> setLanguage(Language language)
           
 Resource<? extends PARENT> setName(String name)
           
 void setQualifier(String qualifier)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.sonar.api.resources.Resource
getLongName, matchFilePattern
 

Constructor Detail

AbstractResource

protected AbstractResource()

AbstractResource

protected AbstractResource(String scope,
                           String qualifier)

AbstractResource

protected AbstractResource(String key,
                           String scope,
                           String qualifier)
Method Detail

getKey

public String getKey()

Specified by:
getKey in interface Resource
Returns:
the resource key

setKey

public Resource<? extends PARENT> setKey(String key)

getName

public String getName()

Specified by:
getName in interface Resource
Returns:
the resource name

setName

public Resource<? extends PARENT> setName(String name)

getDescription

public String getDescription()

Specified by:
getDescription in interface Resource
Returns:
the resource description

setDescription

public Resource<? extends PARENT> setDescription(String description)

getScope

public String getScope()

Specified by:
getScope in interface Resource
Returns:
the scope

setQualifier

public void setQualifier(String qualifier)

getQualifier

public String getQualifier()

Specified by:
getQualifier in interface Resource
Returns:
the qualifier

getLanguage

public Language getLanguage()

Specified by:
getLanguage in interface Resource
Returns:
the language

setLanguage

public Resource<? extends PARENT> setLanguage(Language language)

getParent

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

Specified by:
getParent in interface Resource

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.