| java.lang.Object org.eclipse.jdt.ui.SharedASTProvider
SharedASTProvider | final public class SharedASTProvider (Code) | | The
SharedASTProvider provides access to the
CompilationUnit AST root used by
the current active Java editor.
For performance reasons, not more than one AST should be kept in memory at a time. Therefore, clients must
not keep any references to the shared AST or its nodes or bindings.
Clients can make the following assumptions about the AST:
the AST has a
ITypeRoot as source:
CompilationUnit.getTypeRoot is not null.
the
AST.apiLevel AST API level is
AST.JLS3 API level 3 or higher
the AST has bindings resolved (
AST.hasResolvedBindings )
AST.hasStatementsRecovery statement and
AST.hasBindingsRecovery bindings recovery are enabled
It is possible that in the future a higher API level is used, or that future options will be enabled.
The returned AST is shared. It is marked as
ASTNode.PROTECT and must not be modified. Clients are advised to use
the non-modifying
ASTRewrite to get update scripts.
since: 3.4 |
Inner Class :final public static class WAIT_FLAG | |
Field Summary | |
final public static WAIT_FLAG | WAIT_ACTIVE_ONLY Wait flag indicating that a client requesting an AST
only wants to wait for the shared AST of the active editor. | final public static WAIT_FLAG | WAIT_NO Wait flag indicating that a client requesting an AST
only wants the already available shared AST. | final public static WAIT_FLAG | WAIT_YES Wait flag indicating that a client requesting an AST
wants to wait until an AST is ready. |
Method Summary | |
public static CompilationUnit | getAST(ITypeRoot element, WAIT_FLAG waitFlag, IProgressMonitor progressMonitor) Returns a compilation unit AST for the given Java element. |
WAIT_ACTIVE_ONLY | final public static WAIT_FLAG WAIT_ACTIVE_ONLY(Code) | | Wait flag indicating that a client requesting an AST
only wants to wait for the shared AST of the active editor.
No AST will be created by the AST provider.
|
WAIT_NO | final public static WAIT_FLAG WAIT_NO(Code) | | Wait flag indicating that a client requesting an AST
only wants the already available shared AST.
No AST will be created by the AST provider.
|
WAIT_YES | final public static WAIT_FLAG WAIT_YES(Code) | | Wait flag indicating that a client requesting an AST
wants to wait until an AST is ready.
An AST will be created by this AST provider if the shared
AST is not for the given Java element.
|
|
|