org.netbeans.api.java.source
public abstract class JavaSourceTaskFactory extends Object
JavaSource
Java parsing harness.
Please note that there is usually no need to implement this class directly,
as there are support classes for common JavaSourceTaskFactory
implementations.
This factory should be registered in the global lookup using ServiceProvider
.Modifier | Constructor and Description |
---|---|
protected |
JavaSourceTaskFactory(JavaSource.Phase phase,
JavaSource.Priority priority)
Construct the JavaSourceTaskFactory with given
JavaSource.Phase and JavaSource.Priority . |
Modifier and Type | Method and Description |
---|---|
protected abstract CancellableTask<CompilationInfo> |
createTask(FileObject file)
Create task for a given file.
|
protected void |
fileObjectsChanged()
Notify the infrastructure that the collection of fileobjects has been changed.
|
protected abstract Collection<FileObject> |
getFileObjects()
Specifies on which files should be registered tasks created by this factory.
|
protected void |
reschedule(FileObject file)
Re-run task created by this factory for given file.
|
protected JavaSourceTaskFactory(@NonNull JavaSource.Phase phase, @NonNull JavaSource.Priority priority)
JavaSource.Phase
and JavaSource.Priority
.phase
- phase to use for tasks created by createTask(org.openide.filesystems.FileObject)
priority
- priority to use for tasks created by createTask(org.openide.filesystems.FileObject)
@NonNull protected abstract CancellableTask<CompilationInfo> createTask(FileObject file)
JavaSource
parsing harness with a given priority
and phase
.
Please note that this method should run as quickly as possible.file
- for which file the task should be created.CancellableTask
for a given file.@NonNull protected abstract Collection<FileObject> getFileObjects()
JavaSource
's corresponding to FileObject
s returned from
this method will be registered tasks created by the createTask(org.openide.filesystems.FileObject)
method
of this factory.
If this list changes, a change event should be fired to all registered
ChangeListener
s.FileObject
on which tasks from this factory should be
registered.createTask(org.openide.filesystems.FileObject)
,
#addChangeListener
,
EditorAwareJavaSourceTaskFactory
,
CaretAwareJavaSourceTaskFactory
protected final void fileObjectsChanged()
getFileObjects()
to get a new collection files.protected final void reschedule(FileObject file) throws IllegalArgumentException
file
- task created by this factory for this file is re-run.IllegalArgumentException
Built on March 18 2014. | Portions Copyright 1997-2014 Sun Microsystems, Inc. All rights reserved.