add support for inline templates
Open
good first issue
roadmap
- Dominant language
- Java
- Stars
- 2k
- Forks
- 392
- Avg merge
- 11h 24m
- Merged PRs (30d)
- 36
Description
inline templates:
* with anonymous classes
* with lambda
### Inline templates
Templates can be made inline, if the source code of the transformation is passed appropriately, as an anonymous class, as follows:
```java
// example of inline template definition + instantiation
Template t = new StatementTemplate() {
TemplateParameter> _col_ = createVariableAccess(method.getParameters().get(0));
@Override
public void statement() {
if (_col_.S().size() > 10)
throw new OutOfBoundException();
}
}; // end of inline template
CtStatement injectedCode = t.apply();
```
Contributor guide
Assessment
This issue has not been assessed yet.