Groovy Documentation

org.codenarc.rule.basic
Class ConstantTernaryExpressionRule

java.lang.Object
  org.codenarc.rule.AbstractRule
      org.codenarc.rule.AbstractAstVisitorRule
          org.codenarc.rule.basic.ConstantTernaryExpressionRule

class ConstantTernaryExpressionRule
extends AbstractAstVisitorRule

Rule that checks for ternary expressions with a constant value for the boolean expression, such as:

Also checks for the same types of constant values for the boolean expressions within the "short" ternary expressions, also known as the "Elvis" operator, e.g.:
author:
Chris Mair
version:
$Revision: 325 $ - $Date: 2010-04-18 21:46:07 -0400 (Sun, 18 Apr 2010) $


Property Summary
Class astVisitorClass

String name

int priority

 
Constructor Summary
ConstantTernaryExpressionRule()

 
Method Summary
 
Methods inherited from class AbstractAstVisitorRule
shouldApplyThisRuleTo
 
Methods inherited from class AbstractRule
applyTo, createViolation, createViolation, createViolationForImport, createViolationForImport, getImportsSortedByLineNumber, getName, getPriority, packageNameForImport, setName, setPriority, sourceLineAndNumberForImport, sourceLineAndNumberForImport
 

Property Detail

astVisitorClass

Class astVisitorClass


name

String name


priority

int priority


 
Constructor Detail

ConstantTernaryExpressionRule

ConstantTernaryExpressionRule()


 

Groovy Documentation