Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.jdeveloper.java.provider
Class JdevProviderContext

java.lang.Object
  extended by oracle.jdeveloper.java.provider.ProviderContext
      extended by oracle.jdeveloper.java.provider.JdevProviderContext
All Implemented Interfaces:
ProviderConstants

public class JdevProviderContext
extends ProviderContext

The BaseFileProvider is an abstract starting point for an implementation of the JavaFileProvider interface that relies on a JavaClassLocator instance for locating Java class and source files.

This implementation contains no caching.


Nested Class Summary
protected  class JdevProviderContext.NodeObserver
          The NodeObserver attaches to nodes for which we have created SourceFile instances for, and tracks the given node until the node is closed, or renamed.
 
Field Summary
protected  java.util.Map<java.net.URL,JdevProviderContext.NodeObserver> _urlToObserverMap
          The set of URLs that we are currently tracking.
protected static java.lang.Class JAVACLASSNODE_CLASS
          The JavaClassNode class instance
protected static java.lang.Class JAVASOURCENODE_CLASS
          The JavaSourceNode class instance
 
Fields inherited from class oracle.jdeveloper.java.provider.ProviderContext
CLASS_SUFFIX, provider, SOURCE_SUFFIX
 
Fields inherited from interface oracle.jdeveloper.java.provider.ProviderConstants
CLASS_TYPE, EMPTY_COLLECTION, SOURCE_TYPE, UNKNOWN_TYPE
 
Constructor Summary
JdevProviderContext(boolean allowInMemoryIn)
           
 
Method Summary
protected  void clearTracking()
          Utility routine to stop tracking all Nodes.
 SourceFile createSourceFile(java.net.URL sourceURL, int j2se)
          Instead of directly interacting with the filesystem, use the Ide's Node model.
protected  int getFileType(java.net.URL url)
          Use the recognizer to check for source files and class files.
 SourceFile getSourceFile(java.net.URL url, int j2se)
          Gets a new SourceFile object for the (existing) file at the given URL.
protected  SourcePreferences getSourcePreferences()
          Retrieve preferences options from the coding style manager.
protected  TextBuffer getTextBuffer(java.net.URL url)
          Fetch the TextBuffer for the given URL.
protected  void startTracking(java.net.URL url)
          Utility routine to start tracking the Node represented by the URL.
protected  void stopTracking(java.net.URL url)
          Utility routine to stop tracking the Node represented by the URL.
 boolean writeSourceFile(SourceFile file)
          Called when SourceTransaction.commit() is called for the given file.
 
Methods inherited from class oracle.jdeveloper.java.provider.ProviderContext
getSourceFile, getSourceFileImpl, setProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVACLASSNODE_CLASS

protected static final java.lang.Class JAVACLASSNODE_CLASS
The JavaClassNode class instance


JAVASOURCENODE_CLASS

protected static final java.lang.Class JAVASOURCENODE_CLASS
The JavaSourceNode class instance


_urlToObserverMap

protected java.util.Map<java.net.URL,JdevProviderContext.NodeObserver> _urlToObserverMap
The set of URLs that we are currently tracking.

Constructor Detail

JdevProviderContext

public JdevProviderContext(boolean allowInMemoryIn)
Method Detail

getFileType

protected final int getFileType(java.net.URL url)
Use the recognizer to check for source files and class files.

Overrides:
getFileType in class ProviderContext
Returns:
The type of the URL: CLASS_TYPE, SOURCE_TYPE, or UNKNOWN_TYPE.

getSourcePreferences

protected final SourcePreferences getSourcePreferences()
Retrieve preferences options from the coding style manager.

Overrides:
getSourcePreferences in class ProviderContext
Returns:
The SourcePreferences for user-defined preferences, null if none.

createSourceFile

public SourceFile createSourceFile(java.net.URL sourceURL,
                                   int j2se)
                            throws java.io.IOException,
                                   java.lang.IllegalArgumentException
Instead of directly interacting with the filesystem, use the Ide's Node model.

Overrides:
createSourceFile in class ProviderContext
Parameters:
sourceURL - The source URL to create a new Java file for.
Returns:
The new source file for the source URL, or null if the file already exists.
Throws:
java.io.IOException - if the new file cannot be created.
java.lang.IllegalArgumentException - if the URL is not recognized as a Java source file.

getSourceFile

public SourceFile getSourceFile(java.net.URL url,
                                int j2se)
Description copied from class: ProviderContext
Gets a new SourceFile object for the (existing) file at the given URL. If no file exists at the given URL, null is returned.

Overrides:
getSourceFile in class ProviderContext
Parameters:
url - The source URL to create a new Java file for.
Returns:
The new source file for the source URL, or null if the file did not exist.

writeSourceFile

public boolean writeSourceFile(SourceFile file)
Description copied from class: ProviderContext
Called when SourceTransaction.commit() is called for the given file.

Overrides:
writeSourceFile in class ProviderContext
Returns:
False if an error occurred.

getTextBuffer

protected TextBuffer getTextBuffer(java.net.URL url)
Fetch the TextBuffer for the given URL.

Overrides:
getTextBuffer in class ProviderContext
Returns:
A newly created TextBuffer if successful, null otherwise.

startTracking

protected void startTracking(java.net.URL url)
Utility routine to start tracking the Node represented by the URL.

Overrides:
startTracking in class ProviderContext

stopTracking

protected void stopTracking(java.net.URL url)
Utility routine to stop tracking the Node represented by the URL.


clearTracking

protected void clearTracking()
Utility routine to stop tracking all Nodes.

Overrides:
clearTracking in class ProviderContext

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.