|
|
|
|
|
|
|
|
Re: Generation of field initializers and methods body at JVM Inferring [message #937670 is a reply to message #936599] |
Tue, 09 October 2012 06:58 |
Pascal Degenne Messages: 5 Registered: September 2012 |
Junior Member |
|
|
Hi,
I have been experimenting similar things recently.
Just a hint from what I understood : I guess you could at least generate the import statement using an injected TypeReferenceSerializer. The serialize() method appends the type name to the TreeAppendable but also deals with the import manager if needed.
I mean something like the following :
@Inject extension TypeReferenceSerializer
...
f.toField(name, type) [
val Procedure1<ITreeAppendable> proc = [
append('''new ''')
newTypeRef('java.util.BitSet').serialize(f,it)
append('''(«dataDef.fields.size»)''')
]
initializer = proc
]
Regards,
Pascal
[Updated on: Tue, 09 October 2012 13:16] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03956 seconds