Top Inners Fields Constructors Methods
org.codehaus.groovy.transform.sc.transformers

pack-priv Class BooleanExpressionTransformer

extends Object
Class Inheritance
Imports
org.codehaus.groovy.ast.ClassHelper, .ClassNode, .GroovyCodeVisitor, .MethodNode, .Parameter, org.codehaus.groovy.ast.expr.BinaryExpression, .BooleanExpression, .Expression, .ExpressionTransformer, .NotExpression, org.codehaus.groovy.classgen.AsmClassGenerator, org.codehaus.groovy.classgen.asm.BytecodeHelper, .OperandStack, .WriterController, org.codehaus.groovy.transform.stc.ExtensionMethodNode, org.objectweb.asm.Label, .MethodVisitor, java.lang.reflect.Modifier, java.util.Iterator, .List

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final StaticCompilationTransformer

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv Expression
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

transformerback to summary
private final StaticCompilationTransformer transformer

Constructor Detail

BooleanExpressionTransformerback to summary
pack-priv BooleanExpressionTransformer(final StaticCompilationTransformer transformer)

Method Detail

transformBooleanExpressionback to summary
pack-priv Expression transformBooleanExpression(final BooleanExpression boolX)
org.codehaus.groovy.transform.sc.transformers back to summary

private Class BooleanExpressionTransformer.OptimizingBooleanExpression

extends BooleanExpression
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final ClassNode

Constructor Summary

AccessConstructor and Description
pack-priv
OptimizingBooleanExpression(final Expression expression, final ClassNode type)

Method Summary

Modifier and TypeMethod and Description
private static boolean
private static boolean
isExtended(final ClassNode type, final Iterator<? extends ClassNode> inners)

private static boolean
replaceAsBooleanWithCompareToNull(final ClassNode type, final ClassLoader dgmProvider)

Inline an "expr != null" check instead of boolean conversion iff: (1) the class doesn't define an asBoolean() method (2) no subclass defines an asBoolean() method For (2), check that we are in one of these cases: (a) a final class (b) an effectively-final inner class

public Expression
transformExpression(final ExpressionTransformer transformer)

Overrides org.codehaus.groovy.ast.expr.BooleanExpression.transformExpression.

Return a copy of the expression calling the transformer on any nested expressions
public void
Inherited from org.codehaus.groovy.ast.expr.BooleanExpression:
getExpressiongetText

Field Detail

typeback to summary
private final ClassNode type

Hides org.codehaus.groovy.ast.expr.Expression.type.

Constructor Detail

OptimizingBooleanExpressionback to summary
pack-priv OptimizingBooleanExpression(final Expression expression, final ClassNode type)

Method Detail

isEffectivelyFinalback to summary
private static boolean isEffectivelyFinal(final ClassNode type)
isExtendedback to summary
private static boolean isExtended(final ClassNode type, final Iterator<? extends ClassNode> inners)
replaceAsBooleanWithCompareToNullback to summary
private static boolean replaceAsBooleanWithCompareToNull(final ClassNode type, final ClassLoader dgmProvider)

Inline an "expr != null" check instead of boolean conversion iff: (1) the class doesn't define an asBoolean() method (2) no subclass defines an asBoolean() method For (2), check that we are in one of these cases: (a) a final class (b) an effectively-final inner class

transformExpressionback to summary
public Expression transformExpression(final ExpressionTransformer transformer)

Overrides org.codehaus.groovy.ast.expr.BooleanExpression.transformExpression.

Doc from org.codehaus.groovy.ast.expr.Expression.transformExpression.

Return a copy of the expression calling the transformer on any nested expressions

Annotations
@Override
visitback to summary
public void visit(final GroovyCodeVisitor visitor)

Overrides org.codehaus.groovy.ast.expr.BooleanExpression.visit.

Annotations
@Override