Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsQuestion about access to AST model in JDT
https://www.eclipse.org/forums/index.php/mv/msg/369770/902830/#msg_902830
Raymond Mising name2012-08-20T16:18:41-00:00Re: Question about access to AST model in JDT
https://www.eclipse.org/forums/index.php/mv/msg/369770/902864/#msg_902864
Raymond Mising name wrote on Mon, 20 August 2012 18:18
Hey guys, I have a question about access to AST models in JDT. Does JDT hold the AST model instance of a java file in memory after it is closed from editor? or whenever I want to access the AST model of an un-opened java file, I need to parse it using ASTParser? Thanks.
The AST as provided in package org.eclipse.jdt.core.dom has to be created on-demand, it is never cached, because it is quite a heavy thing (even heavier when created with bindings). So if you as a plug-in developer need access to the AST you have to create it first - and make sure you're not holding on to it longer than necessary.
As you also say "model", let me mention that the Java model provided in package org.eclipse.jdt.core is actually cached in memory, but that's a different animal.
Stephan]]>Stephan Herrmann2012-08-20T18:46:52-00:00Re: Question about access to AST model in JDT
https://www.eclipse.org/forums/index.php/mv/msg/369770/903264/#msg_903264
Raymond Mising name2012-08-22T18:28:18-00:00Re: Question about access to AST model in JDT
https://www.eclipse.org/forums/index.php/mv/msg/369770/903745/#msg_903745
HTH,
Stephan
]]>Stephan Herrmann2012-08-25T11:56:48-00:00