How to add annotations to generated class [message #880616] |
Sat, 02 June 2012 12:53 |
Roger Gilliar Messages: 40 Registered: March 2010 |
Member |
|
|
Hi,
I just started to learn Xtext and decided to build a DSL to generate JPA entities. The first problem I encountered is how to add the @Entity annotation to the generated source ?
def dispatch void infer(Entity element, IJvmDeclaredTypeAcceptor acceptor, boolean isPreIndexingPhase) {
acceptor.accept(
buildClass(element)
).initializeLater([type |
// do something
])
}
def buildClass(Entity element) {
val result = element.toClass(element.name)
result.setDocumentation("Generated JPA entity")
??????? how to add an annotation ?????
result
}
Regards
Roger
[Updated on: Sat, 02 June 2012 12:54] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02709 seconds