org.sonar.api.checks.templates
Class CheckTemplateRepository

java.lang.Object
  extended by org.sonar.api.checks.templates.CheckTemplateRepository
All Implemented Interfaces:
BatchComponent, BatchExtension, Extension, RulesRepository, ServerComponent, ServerExtension

public class CheckTemplateRepository
extends java.lang.Object
implements RulesRepository

EXPERIMENTAL - will be used in version 2.3

Since:
2.1

Constructor Summary
CheckTemplateRepository()
           
CheckTemplateRepository(java.lang.String key)
           
 
Method Summary
static CheckTemplateRepository createFromAnnotatedClasses(java.lang.String repositoryKey, Language language, java.util.Collection<java.lang.Class> classes)
           
static CheckTemplateRepository createFromXml(java.lang.String repositoryKey, Language language, java.lang.String pathToXml)
           
 boolean equals(java.lang.Object o)
           
 java.util.List<Rule> getInitialReferential()
           
 java.lang.String getKey()
           
 Language getLanguage()
           
 java.util.List<RulesProfile> getProvidedProfiles()
           
 CheckTemplate getTemplate(java.lang.String key)
           
 java.util.List<CheckTemplate> getTemplates()
           
 int hashCode()
           
 java.util.List<Rule> parseReferential(java.lang.String fileContent)
          The method to parse the base referential of rules and return a list of rules
 CheckTemplateRepository setKey(java.lang.String key)
           
 CheckTemplateRepository setLanguage(Language l)
           
 CheckTemplateRepository setTemplates(java.util.List<CheckTemplate> c)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckTemplateRepository

public CheckTemplateRepository()

CheckTemplateRepository

public CheckTemplateRepository(java.lang.String key)
Method Detail

getKey

public java.lang.String getKey()

setKey

public CheckTemplateRepository setKey(java.lang.String key)

getLanguage

public Language getLanguage()
Specified by:
getLanguage in interface RulesRepository
Returns:
the language the repository is associated

setLanguage

public CheckTemplateRepository setLanguage(Language l)

getTemplates

public java.util.List<CheckTemplate> getTemplates()

setTemplates

public CheckTemplateRepository setTemplates(java.util.List<CheckTemplate> c)

getTemplate

public CheckTemplate getTemplate(java.lang.String key)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

createFromXml

public static CheckTemplateRepository createFromXml(java.lang.String repositoryKey,
                                                    Language language,
                                                    java.lang.String pathToXml)

createFromAnnotatedClasses

public static CheckTemplateRepository createFromAnnotatedClasses(java.lang.String repositoryKey,
                                                                 Language language,
                                                                 java.util.Collection<java.lang.Class> classes)

getInitialReferential

public java.util.List<Rule> getInitialReferential()
Specified by:
getInitialReferential in interface RulesRepository
Returns:
the list of rules of the repository

parseReferential

public java.util.List<Rule> parseReferential(java.lang.String fileContent)
Description copied from interface: RulesRepository
The method to parse the base referential of rules and return a list of rules

Specified by:
parseReferential in interface RulesRepository
Parameters:
fileContent - the initial referential
Returns:
a list of rules

getProvidedProfiles

public java.util.List<RulesProfile> getProvidedProfiles()
Specified by:
getProvidedProfiles in interface RulesRepository
Returns:
a list of profiles that are provided with the referential


Copyright © 2009-2010 SonarSource. All Rights Reserved.