Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.jdeveloper.java
Interface JavaFileProvider

All Superinterfaces:
JavaProvider
All Known Implementing Classes:
BaseFileProvider, CachedFileProvider, JavaModel, SimpleFileProvider

public interface JavaFileProvider
extends JavaProvider

The JavaFileProvider extends the JavaProvider interface by providing methods to retrieve a JavaFile or SourceFile from a Java class or source URL.


Method Summary
 SourceFile createSourceFile(java.net.URL sourceURL)
          Creates a new SourceFile for the given Java source URL (*.java).
 JavaFile getFile(java.net.URL url)
          Fetch the JavaFile for the given URL.
 SourceFile getSourceFile(TextBuffer textBuffer)
          Creates a new SourceFile from the input TextBuffer but NOT tied any particular Java source URL.
 SourceFile getSourceFile(java.net.URL sourceURL)
          Fetch the SourceFile for the given Java source URL (*.java).
 
Methods inherited from interface oracle.javatools.parser.java.v2.JavaProvider
getArrayType, getClass, getClass, getClassByVMName, getPackage, getSourceClass, getTextBuffer
 

Method Detail

getFile

JavaFile getFile(java.net.URL url)
Fetch the JavaFile for the given URL. The URL can be either a Java class file (*.class) or a Java source file (*.java). The classes contained in that file represented by the URL can be fetched from the JavaFile.

Parameters:
url - the URL to get the Java file for
Returns:
the Java file for that URL.

getSourceFile

SourceFile getSourceFile(java.net.URL sourceURL)
Fetch the SourceFile for the given Java source URL (*.java). The classes contained in the file represented by the URL can be fetched from the source file. If the URL does not represent a valid Java source file, or if the URL points to a non-existing file, then null will be returned.

Parameters:
sourceURL - the source URL to get the Java file for
Returns:
the source file for the source URL

createSourceFile

SourceFile createSourceFile(java.net.URL sourceURL)
                            throws java.io.IOException,
                                   java.lang.IllegalArgumentException
Creates a new SourceFile for the given Java source URL (*.java). This will create a new empty file for the given URL, and return a SourceFile instance for it. If the file already exists on disk, then this will return null.

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 could not be created because it 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

SourceFile getSourceFile(TextBuffer textBuffer)
Creates a new SourceFile from the input TextBuffer but NOT tied any particular Java source URL. In particular, that means that the contents of this SourceFile are NOT fetchable and therefore this SourceFile cannot be referenced by any other.

Returns:
a newly created SourceFile based on the input TextBuffer.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

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