public final class CoreASTProvider extends Object
CoreASTProvider
provides access to the AST root
used by
the current active Java editor.
The CoreASTProvider
contains all methods/functionality that are
not dependent on the UI, from org.eclipse.jdt.internal.ui.javaeditor.ASTProvider
for the purpose of reuse by non-UI bundles.
This class is not intended to be subclassed or instantiated by clients.
Modifier and Type | Class and Description |
---|---|
static class |
CoreASTProvider.WAIT_FLAG
Wait flag class.
|
Modifier and Type | Field and Description |
---|---|
static String |
DEBUG_PREFIX |
static CoreASTProvider.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.
|
static CoreASTProvider.WAIT_FLAG |
WAIT_NO
Wait flag indicating that a client requesting an AST
only wants the already available shared AST.
|
static CoreASTProvider.WAIT_FLAG |
WAIT_YES
Wait flag indicating that a client requesting an AST
wants to wait until an AST is ready.
|
Modifier and Type | Method and Description |
---|---|
void |
aboutToBeReconciled(ITypeRoot javaElement)
Informs that reconciling for the given element is about to be started.
|
void |
cache(CompilationUnit ast,
ITypeRoot javaElement)
Caches the given compilation unit AST for the given Java element.
|
void |
clearReconciliation()
Clear the reconciliation state.
|
void |
disposeAST()
Disposes the cached AST.
|
ITypeRoot |
getActiveJavaElement() |
CompilationUnit |
getAST(ITypeRoot input,
CoreASTProvider.WAIT_FLAG waitFlag,
IProgressMonitor progressMonitor)
Returns a shared compilation unit AST for the given Java element.
|
CompilationUnit |
getCachedAST() |
static CoreASTProvider |
getInstance() |
ITypeRoot |
getReconcilingJavaElement() |
static String |
getThreadName() |
boolean |
isReconciling() |
void |
reconciled(CompilationUnit ast,
ITypeRoot javaElement,
IProgressMonitor progressMonitor)
Update internal structures after reconcile.
|
void |
setActiveJavaElement(ITypeRoot activeJavaElement)
Set the active java element that is currently active.
|
String |
toString(ITypeRoot javaElement)
Returns a string for the given Java element used for debugging.
|
void |
waitLockNotifyAll()
Notify all waiting threads that the AST has changed.
|
public static final String DEBUG_PREFIX
public static final CoreASTProvider.WAIT_FLAG WAIT_YES
An AST will be created by this AST provider if the shared AST is not for the given Java element.
public static final CoreASTProvider.WAIT_FLAG WAIT_ACTIVE_ONLY
No AST will be created by the AST provider.
public static final CoreASTProvider.WAIT_FLAG WAIT_NO
No AST will be created by the AST provider.
public CompilationUnit getAST(ITypeRoot input, CoreASTProvider.WAIT_FLAG waitFlag, IProgressMonitor progressMonitor)
Clients are not allowed to modify the AST and must synchronize all access to its nodes.
input
- the Java element, must not be null
waitFlag
- org.eclipse.jdt.ui.SharedASTProvider#WAIT_YES,
org.eclipse.jdt.ui.SharedASTProvider#WAIT_NO or
org.eclipse.jdt.ui.SharedASTProvider#WAIT_ACTIVE_ONLYprogressMonitor
- the progress monitor or null
null
if the AST is not availablepublic void aboutToBeReconciled(ITypeRoot javaElement)
javaElement
- the Java element
See org.eclipse.jdt.internal.ui.text.java.IJavaReconcilingListener#aboutToBeReconciled()public void reconciled(CompilationUnit ast, ITypeRoot javaElement, IProgressMonitor progressMonitor)
ast
- the compilation unit AST or null
if the working copy was consistent or
reconciliation has been cancelledjavaElement
- the Java element for which the AST was builtprogressMonitor
- the progress monitor
See org.eclipse.jdt.internal.ui.text.java.IJavaReconcilingListener#reconciled(CompilationUnit,
boolean, IProgressMonitor)public void cache(CompilationUnit ast, ITypeRoot javaElement)
ast
- the astjavaElement
- the java elementpublic void disposeAST()
public String toString(ITypeRoot javaElement)
javaElement
- the compilation unit ASTpublic static String getThreadName()
public static CoreASTProvider getInstance()
public boolean isReconciling()
public ITypeRoot getReconcilingJavaElement()
public ITypeRoot getActiveJavaElement()
public void setActiveJavaElement(ITypeRoot activeJavaElement)
activeJavaElement
- the java element.public CompilationUnit getCachedAST()
public void waitLockNotifyAll()
public void clearReconciliation()
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.