* <p/>
* Example of check class:
* <pre>
- * @Rule(key = "S001")
+ * {@literal @}org.sonar.check.Rule(key = "S001")
* public class CheckS001 {
- * @RuleProperty
+ * {@literal @}org.sonar.check.RuleProperty
* private String pattern;
*
* public String getPattern() {
*
* // Checks are used to detect issues on source code
*
- * // checks.ruleKey(obj) can be used to create the detected
- * // issues.
+ * // checks.ruleKey(obj) can be used to create the related issues
* }
* }
* </pre>
import java.util.Collection;
/**
+ * Searches for rules. This component is available by dependency injection. It must not
+ * be extended by plugins.
+ *
* @since 4.2
*/
public interface Rules {
+ /**
+ * Get a rule by its key. Returns <code>null</code> if rule does not exist.
+ */
@CheckForNull
Rule find(RuleKey key);
Collection<Rule> findAll();
+ /**
+ * Get the rules of the given repository. Returns an empty collection if the
+ * repository does not exist.
+ */
Collection<Rule> findByRepository(String repository);
}
import java.util.List;
/**
- * This component should not accessible from plugin API
+ * This component should not be accessed by plugins. Database is not an API.
*
* @since 1.10
*/
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+/**
+ * Replaced by {@link org.sonar.api.batch.fs}
+ */
@ParametersAreNonnullByDefault
package org.sonar.api.scan.filesystem;
import java.util.Set;
/**
- * Defines the coding rules. For example the Java Findbugs plugin provides an implementation of
+ * Defines some coding rules of the same repository. For example the Java Findbugs plugin provides an implementation of
* this extension point in order to define the rules that it supports.
* <p/>
* This interface replaces the deprecated class org.sonar.api.rules.RuleRepository.
* Read definitions of rules based on the annotations provided by sonar-check-api. It is used
* to feed {@link RulesDefinition}.
*
+ * @see org.sonar.api.server.rule.RulesDefinition
* @since 4.3
*/
public class RulesDefinitionAnnotationLoader {
* </rules>
* </pre>
*
+ * @see org.sonar.api.server.rule.RulesDefinition
* @since 4.3
*/
public class RulesDefinitionXmlLoader implements ServerComponent {