Adding method/variable declarations to org.eclipse.jdt.core.dom.CompilationUnit

Posted by Heinrich on Stack Overflow See other posts from Stack Overflow or by Heinrich
Published on 2010-03-29T11:32:40Z Indexed on 2010/03/29 11:33 UTC
Read the original article Hit count: 541

Hi,

i am trying to add method or variable declarations to org.eclipse.jdt.core.dom.CompilationUnit, but I can't figure out how to achieve that.

If I am using CompilationUnit.types().add(...) the element is added as a sibling, not as a child element.

I've really searched a lot now, but I don't believe it's such a big deal.

Thanks for your answers!

heinrich

© Stack Overflow or respective owner

Related posts about eclipse-jdt

Related posts about eclipse