Groovy Documentation

groovy.org.codenarc.rule.unnecessary
[Groovy] Class UnnecessaryInstantiationAstVisitor

java.lang.Object
  org.codenarc.rule.AbstractAstVisitor
      groovy.org.codenarc.rule.unnecessary.UnnecessaryInstantiationAstVisitor

class UnnecessaryInstantiationAstVisitor
extends AbstractAstVisitor

Base visitor for unnecessary constructor calls.

Authors:
Hamlet D'Arcy


Property Summary
List parameterTypes

String suffix

Class targetType

 
Constructor Summary
UnnecessaryInstantiationAstVisitor(Class targetType, List parameterTypes, String suffix)

 
Method Summary
protected boolean isTypeSuffixNecessary(def argument)

protected boolean shouldSkipViolation(Object value)

void visitConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression call)

 

Property Detail

parameterTypes

List parameterTypes


suffix

String suffix


targetType

Class targetType


 
Constructor Detail

UnnecessaryInstantiationAstVisitor

UnnecessaryInstantiationAstVisitor(Class targetType, List parameterTypes, String suffix)


 
Method Detail

isTypeSuffixNecessary

@SuppressWarnings('UnusedMethodParameter')
protected boolean isTypeSuffixNecessary(def argument)


shouldSkipViolation

@SuppressWarnings('UnusedMethodParameter')
protected boolean shouldSkipViolation(Object value)


visitConstructorCallExpression

@Override
final void visitConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression call)


 

Groovy Documentation