org.sonar.api.server.rule
Class RuleDefinitions.NewRepositoryImpl

java.lang.Object
  extended by org.sonar.api.server.rule.RuleDefinitions.NewRepositoryImpl
All Implemented Interfaces:
RuleDefinitions.NewExtendedRepository, RuleDefinitions.NewRepository
Enclosing interface:
RuleDefinitions

public static class RuleDefinitions.NewRepositoryImpl
extends Object
implements RuleDefinitions.NewRepository


Method Summary
 void done()
           
 RuleDefinitions.NewRule loadAnnotatedClass(Class clazz)
          Reads definition of rule from the annotations provided by the library sonar-check-api.
 RuleDefinitions.NewRepositoryImpl loadAnnotatedClasses(Class... classes)
          Reads definitions of rules from the annotations provided by the library sonar-check-api.
 RuleDefinitions.NewRepositoryImpl loadXml(InputStream xmlInput, String encoding)
          Reads definitions of rules from a XML file.
 RuleDefinitions.NewRule newRule(String ruleKey)
           
 RuleDefinitions.NewRule rule(String ruleKey)
           
 RuleDefinitions.NewRepositoryImpl setName(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setName

public RuleDefinitions.NewRepositoryImpl setName(@Nullable
                                                 String s)
Specified by:
setName in interface RuleDefinitions.NewRepository

newRule

public RuleDefinitions.NewRule newRule(String ruleKey)
Specified by:
newRule in interface RuleDefinitions.NewExtendedRepository

rule

@CheckForNull
public RuleDefinitions.NewRule rule(String ruleKey)
Specified by:
rule in interface RuleDefinitions.NewRepository

loadAnnotatedClasses

public RuleDefinitions.NewRepositoryImpl loadAnnotatedClasses(Class... classes)
Description copied from interface: RuleDefinitions.NewExtendedRepository
Reads definitions of rules from the annotations provided by the library sonar-check-api.

Specified by:
loadAnnotatedClasses in interface RuleDefinitions.NewExtendedRepository

loadAnnotatedClass

public RuleDefinitions.NewRule loadAnnotatedClass(Class clazz)
Description copied from interface: RuleDefinitions.NewExtendedRepository
Reads definition of rule from the annotations provided by the library sonar-check-api.

Specified by:
loadAnnotatedClass in interface RuleDefinitions.NewExtendedRepository

loadXml

public RuleDefinitions.NewRepositoryImpl loadXml(InputStream xmlInput,
                                                 String encoding)
Description copied from interface: RuleDefinitions.NewExtendedRepository
Reads definitions of rules from a XML file. Format is :
 <rules>
 <rule>
 <!-- required fields -->
 <key>the-rule-key</key>
 <name>The purpose of the rule</name>
 <description>
 <![CDATA[The description]]>
 </description>

 <!-- optional fields -->
 <internalKey>Checker/TreeWalker/LocalVariableName</internalKey>
 <severity>BLOCKER</severity>
 <cardinality>MULTIPLE</cardinality>
 <status>BETA</status>
 <param>
 <key>the-param-key</key>
 <tag>style</tag>
 <tag>security</tag>
 <description>
 <![CDATA[
 the param-description
 ]]>
 </description>
 <defaultValue>42</defaultValue>
 </param>
 <param>
 <key>another-param</key>
 </param>

 <!-- deprecated fields -->
 <configKey>Checker/TreeWalker/LocalVariableName</configKey>
 <priority>BLOCKER</priority>
 </rule>
 </rules>

 

Specified by:
loadXml in interface RuleDefinitions.NewExtendedRepository

done

public void done()
Specified by:
done in interface RuleDefinitions.NewExtendedRepository


Copyright © 2009-2014 SonarSource. All Rights Reserved.