public interface Associator
Tracability
Modifier and Type | Method and Description |
---|---|
void |
setPrimarySourceElement(MutableElement javaElement,
Element sourceElement)
Associates the generate element with the Xtend source code.
|
void setPrimarySourceElement(MutableElement javaElement, Element sourceElement)
myClass.declaredFields.forEach[field| myClass.addMethod("get" + field.simpleName.toFirstUpper) [ primarySourceElement = field // return type, body etc... ] ]This way, the getter generated in the active annotation above would be associated with the field in the Xtend source code. Notice that we passed the field from the Java AST as a source element. This is a shortcut for
primarySourceElement = field.primarySourceElement
sourceElement
- the source element that the secondaryElement was derived fromjavaElement
- the generated Java element