|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jdeveloper.java.provider.ProviderContext
public class ProviderContext
Defines various aspects of the context for the FileProvider implementations. Subclasses may override various aspects for different behavior.
One aspect is the filesystem interface for creating, getting, and writing SourceFiles. The default implementation reads and writes files directly to the file system.
One aspect is an interface for determining what file type (source file or class file) a particular input URL is. The default implementation checks the file suffix.
One aspect is an interface for retrieving user-defined preferences (mostly related to formatting). The default implementation returns nothing since there are no user-defined preferences in the base implementation.
One aspect is an interface for tracking changes made to a set of URLs. The default implementation does nothing since there is no tracking ability in the base implementation.
Field Summary | |
---|---|
protected static java.lang.String |
CLASS_SUFFIX The default suffix of a Java class file. |
protected BaseFileProvider |
provider Provider cookie used for new SourceFiles. |
protected static java.lang.String |
SOURCE_SUFFIX The default suffix of a Java source file. |
Fields inherited from interface oracle.jdeveloper.java.provider.ProviderConstants |
---|
CLASS_TYPE, EMPTY_COLLECTION, SOURCE_TYPE, UNKNOWN_TYPE |
Constructor Summary | |
---|---|
ProviderContext() |
Method Summary | |
---|---|
protected void |
clearTracking() Stops all tracking. |
SourceFile |
createSourceFile(java.net.URL url, int j2se) Creates a new file at the given URL (*.java) and creates a SourceFile object for it. |
protected int |
getFileType(java.net.URL url) |
protected SourceFile |
getSourceFile(TextBuffer textBuffer, int j2se) Creates a new SourceFile for the given TextBuffer. |
SourceFile |
getSourceFile(java.net.URL url, int j2se) Gets a new SourceFile object for the (existing) file at the given URL. |
protected SourceFile |
getSourceFileImpl(java.net.URL url, int j2se) |
protected SourcePreferences |
getSourcePreferences() Gets the user-defined preferences. |
protected TextBuffer |
getTextBuffer(java.net.URL url) Reads the contents of the given URL into a new TextBuffer. |
void |
setProvider(BaseFileProvider providerIn) Sets the provider cookie that will be used for new SourceFile instances and will also be notified when URLs have been changed. |
protected void |
startTracking(java.net.URL url) Starts tracking changes made to the given URL. |
boolean |
writeSourceFile(SourceFile file) Called when SourceTransaction.commit() is called for the given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String CLASS_SUFFIX
protected static final java.lang.String SOURCE_SUFFIX
protected BaseFileProvider provider
Constructor Detail |
---|
public ProviderContext()
Method Detail |
---|
public void setProvider(BaseFileProvider providerIn)
protected int getFileType(java.net.URL url)
protected SourcePreferences getSourcePreferences()
public SourceFile createSourceFile(java.net.URL url, int j2se) throws java.io.IOException, java.lang.IllegalArgumentException
url
- The source URL to create a new Java file for.java.io.IOException
- if the new file cannot be created.java.lang.IllegalArgumentException
- if the URL is not recognized as a Java source file.public SourceFile getSourceFile(java.net.URL url, int j2se) throws java.lang.IllegalArgumentException
url
- The source URL to create a new Java file for.java.lang.IllegalArgumentException
- if the URL is not recognized as a Java source file.protected SourceFile getSourceFileImpl(java.net.URL url, int j2se) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public boolean writeSourceFile(SourceFile file)
protected final SourceFile getSourceFile(TextBuffer textBuffer, int j2se)
protected TextBuffer getTextBuffer(java.net.URL url) throws java.io.FileNotFoundException
The caller is responsible for checking to see that the file exists before calling.
If any IO exception occurs, null gets returned.
java.io.FileNotFoundException
protected void startTracking(java.net.URL url)
If a change is made to the given URL, then this should call BaseFileProvider.notifyOfChange(URL)
.
protected void clearTracking()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |