|
org.netbeans.modules.java.source 0.60.2 10 | |||||||||
| 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.Task
or runModificationTask(org.netbeans.api.java.source.Task 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 FileObjects
and classpath represented by given ClasspathInfo. |
static JavaSource |
create(ClasspathInfo cpInfo,
FileObject... files)
Returns a JavaSource instance representing given FileObjects
and classpath represented by given ClasspathInfo. |
static JavaSource |
forDocument(Document doc)
Returns a JavaSource instance associated to the given Document,
it returns null if the Document is not
associated 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 associated with data type providing the JavaSource. |
ClasspathInfo |
getClasspathInfo()
Returns the classpaths ( ClasspathInfo) used by this
JavaSource |
Collection<FileObject> |
getFileObjects()
Returns unmodifiable Collection of FileObjects used by this JavaSource |
ModificationResult |
runModificationTask(Task<WorkingCopy> task)
Runs a task which permits for modifying the sources. |
void |
runUserActionTask(Task<CompilationController> task,
boolean shared)
Runs a task which permits for controlling phases of the parsing process. |
Future<Void> |
runWhenScanFinished(Task<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 |
|---|
@NullUnknown
public static JavaSource create(@NonNull
ClasspathInfo cpInfo,
@NonNull
FileObject... files)
throws IllegalArgumentException
JavaSource instance representing given FileObjects
and classpath represented by given ClasspathInfo.
cpInfo - the classpaths to be used.files - for which the JavaSource should be created
JavaSource
IllegalArgumentException - if fileObject or cpInfo is null
@NullUnknown
public static JavaSource create(@NonNull
ClasspathInfo cpInfo,
@NonNull
Collection<? extends FileObject> files)
throws IllegalArgumentException
JavaSource instance representing given FileObjects
and classpath represented by given ClasspathInfo.
cpInfo - the classpaths to be used.files - for which the JavaSource should be created
JavaSource
IllegalArgumentException - if fileObject or cpInfo is null
@CheckForNull
public static JavaSource forFileObject(@NonNull
FileObject fileObject)
throws IllegalArgumentException
JavaSource instance associated to given FileObject,
it returns null if the Document is not associated with data type providing the JavaSource.
fileObject - for which the JavaSource should be found/created.
JavaSource or null
IllegalArgumentException - if fileObject is null
@CheckForNull
public static JavaSource forDocument(@NonNull
Document doc)
throws IllegalArgumentException
JavaSource instance associated to the given Document,
it returns null if the Document is not
associated with data type providing the JavaSource.
doc - Document for which the JavaSource should be found/created.
JavaSource or null
IllegalArgumentException - if doc is null
public void runUserActionTask(@NonNull
Task<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.Task into another runUserActionTask(org.netbeans.api.java.source.Task.
It's also legal to nest the runModificationTask(org.netbeans.api.java.source.Task into runUserActionTask(org.netbeans.api.java.source.Task,
the outer runUserActionTask(org.netbeans.api.java.source.Task does not see changes caused by nested runModificationTask(org.netbeans.api.java.source.Task,
but the following nested task see them.
IOExceptionfor information about implementation requirements
@NonNull
public Future<Void> runWhenScanFinished(@NonNull
Task<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
@NonNull
public ModificationResult runModificationTask(@NonNull
Task<WorkingCopy> task)
throws IOException
task - The task which.
IOExceptionfor information about implementation requirements@NonNull public ClasspathInfo getClasspathInfo()
ClasspathInfo) used by this
JavaSource
ClasspathInfo, never returns null.@NonNull public Collection<FileObject> getFileObjects()
Collection of FileObjects used by this JavaSource
FileObjects
|
org.netbeans.modules.java.source 0.60.2 10 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||