public class ContractClosureWriter
extends Object
Replaces annotation closures with closure implementation classes.
Attention: large parts of this class have been backported from Groovy 1.8 and customized for usage in groovy-contracts.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public ClassNode |
createClosureClass(ClassNode classNode, MethodNode methodNode, ClosureExpression expression, boolean addOldVariable, boolean addResultVariable, int mods)Generates a synthetic closure implementation class for the supplied contract closure. |
Generates a synthetic closure implementation class for the supplied contract closure.
classNode - the declaring classmethodNode - the owning method or constructor, or null for class invariantsexpression - the rewritten closure bodyaddOldVariable - whether to expose the old map parameteraddResultVariable - whether to expose the result parametermods - the access modifiers to apply to the generated class