Groovy Documentation

groovy.org.codenarc.rule.generic
[Groovy] Class RequiredRegexRule

java.lang.Object
  org.codenarc.rule.AbstractRule
      groovy.org.codenarc.rule.generic.RequiredRegexRule

class RequiredRegexRule
extends AbstractRule

Checks for a specified regular expression that must exist within the source code.

The regex property specifies the regular expression to check for. If null or empty, do nothing.

A RuleSet can contain any number of instances of this rule, but each should be configured with a unique rule name, regex, violationMessage and (optionally) customized priority.

Authors:
Chris Mair


Property Summary
String name

int priority

String regex

 
Method Summary
void applyTo(SourceCode sourceCode, List violations)

boolean isReady()

 

Property Detail

name

String name


priority

int priority


regex

String regex


 
Method Detail

applyTo

void applyTo(SourceCode sourceCode, List violations)


isReady

boolean isReady()


 

Groovy Documentation