|
org.netbeans.modules.java.source 0.13.0 1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.api.java.source.JavaSource
public final class JavaSource
Class representing Java source file opened in the editor.
Nested Class Summary | |
---|---|
static class |
JavaSource.InsufficientMemoryException
This specialization of IOException signals that a runUserActionTask(org.netbeans.api.java.source.CancellableTask
or runModificationTask(org.netbeans.api.java.source.CancellableTask failed due to lack of memory. |
static class |
JavaSource.Phase
|
static class |
JavaSource.Priority
|
Method Summary | |
---|---|
static JavaSource |
create(ClasspathInfo cpInfo,
Collection<? extends FileObject> files)
Returns a JavaSource instance representing given FileObject s
and classpath represented by given ClasspathInfo . |
static JavaSource |
create(ClasspathInfo cpInfo,
FileObject... files)
Returns a JavaSource instance representing given FileObject s
and classpath represented by given ClasspathInfo . |
static JavaSource |
forDocument(Document doc)
Returns a JavaSource instance associated to FileObject
the Document was created from, it returns null if the Document is not
associanted with data type providing the JavaSource . |
static JavaSource |
forFileObject(FileObject fileObject)
Returns a JavaSource instance associated to given FileObject ,
it returns null if the Document is not associanted with data type providing the JavaSource . |
ClasspathInfo |
getClasspathInfo()
Returns the classpaths ( ClasspathInfo ) used by this
JavaSource |
Collection<FileObject> |
getFileObjects()
Returns unmodifiable Collection of FileObject s used by this JavaSource |
ModificationResult |
runModificationTask(CancellableTask<WorkingCopy> task)
Runs a task which permits for modifying the sources. |
void |
runUserActionTask(CancellableTask<CompilationController> task,
boolean shared)
Runs a task which permits for controlling phases of the parsing process. |
Future<Void> |
runWhenScanFinished(CancellableTask<CompilationController> task,
boolean shared)
Performs the given task when the scan finished. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static JavaSource create(ClasspathInfo cpInfo, Collection<? extends FileObject> files) throws IllegalArgumentException
JavaSource
instance representing given FileObject
s
and classpath represented by given ClasspathInfo
.
cpInfo
- the classpaths to be used.files
- for which the JavaSource
should be created
JavaSource
{@link
- IllegalArgumentException} if fileObject or cpInfo is null
IllegalArgumentException
public static JavaSource create(ClasspathInfo cpInfo, FileObject... files) throws IllegalArgumentException
JavaSource
instance representing given FileObject
s
and classpath represented by given ClasspathInfo
.
cpInfo
- the classpaths to be used.files
- for which the JavaSource
should be created
JavaSource
{@link
- IllegalArgumentException} if fileObject or cpInfo is null
IllegalArgumentException
public static JavaSource forFileObject(FileObject fileObject) throws IllegalArgumentException
JavaSource
instance associated to given FileObject
,
it returns null if the Document
is not associanted with data type providing the JavaSource
.
fileObject
- for which the JavaSource
should be found/created.
JavaSource
or null
{@link
- IllegalArgumentException} if fileObject is null
IllegalArgumentException
public static JavaSource forDocument(Document doc) throws IllegalArgumentException
JavaSource
instance associated to FileObject
the Document
was created from, it returns null if the Document
is not
associanted with data type providing the JavaSource
.
doc
- Document
for which the JavaSource
should be found/created.
JavaSource
or null
{@link
- IllegalArgumentException} if doc is null
IllegalArgumentException
public void runUserActionTask(CancellableTask<CompilationController> task, boolean shared) throws IOException
JavaSourceTaskFactory
.
task
- The task which.shared
- if true the java compiler may be reused by other org.netbeans.api.java.source.CancellableTasks
,
the value false may have negative impact on the IDE performance.
It's legal to nest the runUserActionTask(org.netbeans.api.java.source.CancellableTask
into another runUserActionTask(org.netbeans.api.java.source.CancellableTask
.
It's also legal to nest the runModificationTask(org.netbeans.api.java.source.CancellableTask
into runUserActionTask(org.netbeans.api.java.source.CancellableTask
,
the outer runUserActionTask(org.netbeans.api.java.source.CancellableTask
does not see changes caused by nested runModificationTask(org.netbeans.api.java.source.CancellableTask
,
but the following nested task see them.
IOException
for information about implementation requirements
public Future<Void> runWhenScanFinished(CancellableTask<CompilationController> task, boolean shared) throws IOException
task
- to be performedshared
- if true the java compiler may be reused by other org.netbeans.api.java.source.CancellableTasks
,
the value false may have negative impact on the IDE performance.
Future
which can be used to find out the sate of the task Future.isDone()
or Future.isCancelled()
.
The caller may cancel the task using Future.cancel(boolean)
or wait until the task is performed Future.get()
.
IOException
- encapsulating the exception thrown by CancellableTasks#run
public ModificationResult runModificationTask(CancellableTask<WorkingCopy> task) throws IOException
task
- The task which.
IOException
for information about implementation requirements
public ClasspathInfo getClasspathInfo()
ClasspathInfo
) used by this
JavaSource
ClasspathInfo
, never returns null.public Collection<FileObject> getFileObjects()
Collection
of FileObject
s used by this JavaSource
FileObject
s
|
org.netbeans.modules.java.source 0.13.0 1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |