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

java.lang.Object
  extended by org.sonar.api.resources.AbstractResource<PARENT>
All Implemented Interfaces:
Resource
Direct Known Subclasses:
Directory, File, JavaFile, JavaPackage

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

setKey

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

getName

public String getName()
Specified by:
getName in interface Resource

setName

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

getDescription

public String getDescription()
Specified by:
getDescription in interface Resource

setDescription

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

getScope

public String getScope()
Specified by:
getScope in interface Resource

setQualifier

public void setQualifier(String qualifier)

getQualifier

public String getQualifier()
Specified by:
getQualifier in interface Resource

getLanguage

public Language getLanguage()
Specified by:
getLanguage in interface Resource

setLanguage

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

getParent

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

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.