|
Project Information
|
Install this plugin and you would be able to delegate methods from a containing class to its delegate member. A delegate member is the containing class'es field annotated with @Delegate The priority of the method look up is as follows:
Example: class DomainService {
def add(Domain d) {
// ...
}
}
class ComponentService {
@Delegate
def domainService = new DomainService()
}
class ComponentController {
ComponentService componentService;
def save {
// invoking DomainService#add(...) directly from an instance of ComponentService
componentService.add(...);
}
}
|