|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jdeveloper.java.provider.BaseFileProvider
public abstract class BaseFileProvider
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 |
BaseFileProvider.BaseClass Our ClCass implementation to override handling of inner class searching and source file hints for SourceClass searching. |
protected class |
BaseFileProvider.BasePackage This is a basic wrapper implementation of JavaPackage . |
Field Summary | |
---|---|
protected ProviderContext |
context Environment defining filesystem access, user-defined preference retrieval, and other things. |
Fields inherited from interface oracle.jdeveloper.java.provider.ProviderConstants |
---|
CLASS_TYPE, EMPTY_COLLECTION, SOURCE_TYPE, UNKNOWN_TYPE |
Constructor Summary | |
---|---|
protected |
BaseFileProvider(ProviderContext contextIn) |
Method Summary | |
---|---|
protected void |
checkInterrupt() |
SourceFile |
createSourceFile(java.net.URL sourceURL) Creates a new SourceFile for the given Java source URL (*.java). |
JavaType |
getArrayType(JavaType component, int dimensions) Fetch the JavaType representing the given array type of the specified component type and dimensions. |
protected JavaType |
getArrayTypeImpl(java.lang.String typeKey, JavaType component, int dimensions) Fetch the array type represented by the given type and dimensions. |
JavaClass |
getClass(java.lang.String fqName) If fqName is a primitive type, the implementer is required to return the canonical PrimitiveType instance. |
JavaClass |
getClass(java.lang.String fqPrefix, java.lang.String name) The same thing as getClass(S) except that the client can save on the string concatenate. |
JavaClass |
getClassByVMName(java.lang.String fqVMName) Fetch the JavaClass for the specified fully-qualified type name in VM notation. |
protected JavaClass |
getClassByVMNameImpl(java.lang.String fqVMName, boolean interruptibly) |
JavaClass |
getClassByVMNameInterruptibly(java.lang.String fqVMName) Fetch the JavaClass for the specified fully-qualified type name in VM notation. |
protected JavaClass |
getClassExactImpl(java.lang.String fqOuterClassName) Utility routine to try to locate the given outer class. |
protected JavaClass |
getClassExactImplInterruptibly(java.lang.String fqOuterClassName) Utility routine to try to locate the given outer class. |
protected JavaFile |
getClassFileImpl(java.net.URL classURL) Fetch the JavaFile for the given Java class URL (*.class). |
protected JavaClass |
getClassImpl(java.lang.String fqName, boolean interruptibly) If fqName is a primitive type, the implementer is required to return the canonical PrimitiveType instance. |
protected JavaClass |
getClassImpl(java.lang.String fqPrefix, java.lang.String name, boolean interruptibly) The same thing as getClass(S) except that the client can save on the string concatenate. |
JavaClass |
getClassInterruptibly(java.lang.String fqName) If fqName is a primitive type, the implementer is required to return the canonical PrimitiveType instance. |
JavaClass |
getClassInterruptibly(java.lang.String fqPrefix, java.lang.String name) The same thing as getClass(S) except that the client can save on the string concatenate. |
protected JavaClass |
getClassLeftToRight(java.lang.String fqName) Utility routine to do the left-to-right resolution search to try to locate a given class. |
protected JavaClass |
getClassLeftToRightImpl(java.lang.String fqName, boolean interruptibly) Utility routine to do the left-to-right resolution search to try to locate a given class. |
protected JavaClass |
getClassLeftToRightInterruptibly(java.lang.String fqName) Utility routine to do the left-to-right resolution search to try to locate a given class. |
abstract JavaClassLocator |
getClassLocator() Fetch the class locator to use for locating files. |
JavaClassLocator |
getClassLocatorInterruptibly() Get the class locator for this provider. |
ProviderContext |
getConteXt() Gets the context that this provider is using. |
JavaFile |
getFile(java.net.URL url) Fetch the JavaFile for the given URL. |
protected int |
getFileType(java.net.URL url) |
protected JavaClass |
getInnerClassByVMName(java.lang.String fqVMName) Utility routine to locate inner classes for *.class files only based on the raw VM notation name. |
protected JavaFile |
getJavaFile(JavaClass javaClass) Fetch the JavaFile instance for a JavaClass. |
protected JavaFile |
getLightSourceFileImpl(java.net.URL sourceURL) Fetch a "light" SourceFile for the given Java source URL (*.java), packaged as a JavaFile. |
JavaPackage |
getPackage(java.lang.String fqName) Fetch the JavaPackage for the given fully-qualified package prefix. |
protected JavaPackage |
getPackage(java.lang.String packagePrefix, java.lang.String name) Gets the given sub package. |
protected BaseFileProvider.BasePackage |
getPackageImpl(java.lang.String fqName) Fetch the JavaPackage instance for the given package. |
protected JavaClass |
getPrimitiveClass(java.lang.String name) |
SourceClass |
getSourceClass(java.lang.String fqName) Retrieves the matching top-level SourceClass in the search space. |
protected SourceClass |
getSourceClassByHint(JavaClass searchClass, java.lang.String sourceFileHint) Retrieves the matching top-level SourceClass in the search space. |
protected SourceClass |
getSourceClassImpl(java.lang.String fqName, boolean interruptibly) Retrieves the matching top-level SourceClass in the search space. |
SourceClass |
getSourceClassInterruptibly(java.lang.String fqName) Retrieves the matching top-level SourceClass in the search space. |
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). |
protected SourceFile |
getSourceFileImpl(java.net.URL sourceURL) Fetch the SourceFile for the given Java source URL (*.java). |
protected int |
getTargetJdkVersion() Get the target JDK version |
TextBuffer |
getTextBuffer(java.net.URL url) Fetch a TextBuffer instance for the specified URL. |
protected JavaClass |
locateClass(JavaClass javaClass, java.lang.String fqName) Utility routine to search through the given JavaClass instance to find the fully-qualified class specified. |
protected JavaClass |
locateClass(JavaFile javaFile, java.lang.String fqName) Utility routine to search through the given JavaFile instance to find the fully-qualified class specified. |
protected JavaClass |
locateClassByVMName(JavaClass javaClass, java.lang.String fqVMName) Utility routine to search through the given JavaClass instance to find the fully-qualified class by raw name. |
protected SourceClass |
locateSourceClass(SourceClass sourceClass, java.lang.String fqName) Source version of locateClass() for locating SourceClass instances. |
protected SourceClass |
locateSourceClass(SourceFile sourceFile, java.lang.String fqName) Source version of locateClass() for locating a SourceClass instance within a SourceFile. |
void |
notifyOfChange(java.net.URL url) Called by the ProviderEnvironment when a change has happened to an URL that we were tracking. |
void |
setConteXt(ProviderContext c) Sets the context that we'll use. |
protected void |
setTargetJdkVersion(int targetJdkVersion) Set the target JDK version, valid values are JavaConstants.J2SE_* |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ProviderContext context
Constructor Detail |
---|
protected BaseFileProvider(ProviderContext contextIn)
Method Detail |
---|
public abstract JavaClassLocator getClassLocator()
public JavaClassLocator getClassLocatorInterruptibly() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the calling thread is interrupted while the locator is being createdpublic ProviderContext getConteXt()
public void setConteXt(ProviderContext c)
public void notifyOfChange(java.net.URL url)
protected final int getFileType(java.net.URL url)
public JavaFile getFile(java.net.URL url)
getFile
in interface JavaFileProvider
url
- the URL to get the Java file forpublic TextBuffer getTextBuffer(java.net.URL url)
JavaProvider
TextBuffer
instance for the specified URL. This is used currently for parsing and resolving a SourceFile. This method may be removed in the future.getTextBuffer
in interface JavaProvider
url
- the URL to fetch the TextBuffer forpublic SourceFile getSourceFile(java.net.URL sourceURL)
getSourceFile
in interface JavaFileProvider
sourceURL
- the source URL to get the Java file forpublic SourceFile getSourceFile(TextBuffer textBuffer)
getSourceFile
in interface JavaFileProvider
protected JavaFile getClassFileImpl(java.net.URL classURL)
classURL
- the class URL to get the Java file forprotected JavaFile getJavaFile(JavaClass javaClass)
protected SourceFile getSourceFileImpl(java.net.URL sourceURL)
sourceURL
- the source URL to get the SourceFile forprotected JavaFile getLightSourceFileImpl(java.net.URL sourceURL)
sourceURL
- the source URL from which to get the sourcepublic SourceFile createSourceFile(java.net.URL sourceURL) throws java.io.IOException, java.lang.IllegalArgumentException
createSourceFile
in interface JavaFileProvider
sourceURL
- the source URL to create a new Java file forjava.io.IOException
- if the new file cannot be createdjava.lang.IllegalArgumentException
- if the URL is not recognized as a Java source filepublic JavaClass getClass(java.lang.String fqName)
getClass
in interface JavaProvider
fqName
- The fully qualified name in dotted notation. e.g. java.lang.Object, java.util.Map.Entrypublic JavaClass getClassInterruptibly(java.lang.String fqName) throws java.lang.InterruptedException
getClassInterruptibly
in interface JavaProvider2
fqName
- The fully qualified name in dotted notation. e.g. java.lang.Object, java.util.Map.Entryjava.lang.InterruptedException
- when the operation is interruptedprotected JavaClass getClassImpl(java.lang.String fqName, boolean interruptibly) throws java.lang.InterruptedException
fqName
- The fully qualified name in dotted notation. e.g. java.lang.Object, java.util.Map.Entryinterruptibly
- if true, throw InterruptedExceptions when interruptedjava.lang.InterruptedException
- when the operation is interruptedprotected JavaClass getClassLeftToRight(java.lang.String fqName)
fqName
- the fully-qualified class name in dotted notationprotected JavaClass getClassLeftToRightInterruptibly(java.lang.String fqName) throws java.lang.InterruptedException
fqName
- the fully-qualified class name in dotted notationjava.lang.InterruptedException
- if the operation was interruptedprotected JavaClass getClassLeftToRightImpl(java.lang.String fqName, boolean interruptibly) throws java.lang.InterruptedException
fqName
- the fully-qualified class name in dotted notationinterruptibly
- If true, throw an InterruptedException when interrupted.java.lang.InterruptedException
- if the operation was interruptedprotected JavaClass getClassExactImpl(java.lang.String fqOuterClassName)
fqOuterClassName
- the name of the fully-qualified outer class name we are searching forprotected JavaClass getClassExactImplInterruptibly(java.lang.String fqOuterClassName) throws java.lang.InterruptedException
fqOuterClassName
- the name of the fully-qualified outer class name we are searching forjava.lang.InterruptedException
- if the search was interruptedprotected void checkInterrupt() throws java.lang.InterruptedException
java.lang.InterruptedException
public JavaClass getClass(java.lang.String fqPrefix, java.lang.String name)
getClass
in interface JavaProvider
fqPrefix
- the fully-qualified prefixname
- the name of the classpublic JavaClass getClassInterruptibly(java.lang.String fqPrefix, java.lang.String name) throws java.lang.InterruptedException
getClassInterruptibly
in interface JavaProvider2
fqPrefix
- the fully-qualified prefixname
- the name of the classjava.lang.InterruptedException
- if the task was interruptedprotected JavaClass getClassImpl(java.lang.String fqPrefix, java.lang.String name, boolean interruptibly) throws java.lang.InterruptedException
java.lang.InterruptedException
public JavaClass getClassByVMName(java.lang.String fqVMName)
JavaProvider
JavaClass
for the specified fully-qualified type name in VM notation. The type may denote an array type, a primitive type, or a class type.
If the qualified name specified represents an array type, the implementer should fetch the JavaClass
for the underlying class first, then generate an array type for the class using getArrayType( class, dimensions )
.
If the qualified name specifies a primitive type, the implementer is required to return the canonical PrimitiveType
instance.
If the qualified name represents a class type, the implementation has the choice of fetching the class information from either a Java class (*.class) or source (*.java) file. The choice is given to implementations for performance reasons, though implementations are required to provide up-to-date information.
The '/' is a package delimiter, while the '$' can be treated literally as part of the class name, or as a class delimiter. Implementations must perform left-to-right resolution on the class name portion to determine whether '$' should be interpreted literally, or as a delimiter.
Although implementations are not required to return the same JavaClass
instance each time, they are encouraged to do so as it will dramatically improve performance.
getClassByVMName
in interface JavaProvider
fqVMName
- The fully qualified type name (different from the qualified source name and different from the descriptor) in VM notation. e.g. java/lang/Object, java/util/Map$Entrypublic JavaClass getClassByVMNameInterruptibly(java.lang.String fqVMName) throws java.lang.InterruptedException
JavaProvider2
JavaClass
for the specified fully-qualified type name in VM notation. The type may denote an array type, a primitive type, or a class type.
If the qualified name specified represents an array type, the implementer should fetch the JavaClass
for the underlying class first, then generate an array type for the class using getArrayType( class, dimensions )
.
If the qualified name specifies a primitive type, the implementer is required to return the canonical PrimitiveType
instance.
If the qualified name represents a class type, the implementation has the choice of fetching the class information from either a Java class (*.class) or source (*.java) file. The choice is given to implementations for performance reasons, though implementations are required to provide up-to-date information.
The '/' is a package delimiter, while the '$' can be treated literally as part of the class name, or as a class delimiter. Implementations must perform left-to-right resolution on the class name portion to determine whether '$' should be interpreted literally, or as a delimiter.
Although implementations are not required to return the same JavaClass
instance each time, they are encouraged to do so as it will dramatically improve performance.
getClassByVMNameInterruptibly
in interface JavaProvider2
fqVMName
- The fully qualified type name (different from the qualified source name and different from the descriptor) in VM notation. e.g. java/lang/Object, java/util/Map$Entryjava.lang.InterruptedException
- when the operation is interruptedprotected JavaClass getClassByVMNameImpl(java.lang.String fqVMName, boolean interruptibly) throws java.lang.InterruptedException
fqVMName
- The fully qualified type name (different from the qualified source name and different from the descriptor) in VM notation. e.g. java/lang/Object, java/util/Map$Entryinterruptibly
- if true, throw InterruptedExceptions when interruptedjava.lang.InterruptedException
- when the operation is interruptedprotected JavaClass getInnerClassByVMName(java.lang.String fqVMName)
fqVMName
- the raw VM name, such as "java/util/Map$Entry"protected JavaClass locateClass(JavaFile javaFile, java.lang.String fqName)
javaFile
- the java file to search throughfqName
- the fully-qualified class name to search forprotected JavaClass locateClass(JavaClass javaClass, java.lang.String fqName)
javaClass
- the class instance to search throughfqName
- the fully-qualified class name we are searching forprotected JavaClass locateClassByVMName(JavaClass javaClass, java.lang.String fqVMName)
javaClass
- the class instance to search throughfqVMName
- the fully-qualified raw class name we are searching forpublic SourceClass getSourceClass(java.lang.String fqName)
getSourceClass
in interface JavaProvider
fqName
- The fully qualified name in dotted notation. e.g. java.lang.Object, java.util.Map.Entrypublic SourceClass getSourceClassInterruptibly(java.lang.String fqName) throws java.lang.InterruptedException
getSourceClassInterruptibly
in interface JavaProvider2
fqName
- The fully qualified name in dotted notation. e.g. java.lang.Object, java.util.Map.Entryjava.lang.InterruptedException
- if the taks is interruptedprotected SourceClass getSourceClassImpl(java.lang.String fqName, boolean interruptibly) throws java.lang.InterruptedException
fqName
- The fully qualified name in dotted notation. e.g. java.lang.Object, java.util.Map.Entryjava.lang.InterruptedException
- if the taks is interruptedprotected SourceClass getSourceClassByHint(JavaClass searchClass, java.lang.String sourceFileHint)
sourceFileHint
- The SourceFile attribute (or a synthetic equivalent) value from the class file. May be null.protected SourceClass locateSourceClass(SourceFile sourceFile, java.lang.String fqName)
sourceFile
- the source file instance to search throguhfqName
- the fully-qualified class name we are searching forprotected SourceClass locateSourceClass(SourceClass sourceClass, java.lang.String fqName)
sourceClass
- the source class instance to search throughfqName
- the fully-qualified class name we are searching forprotected JavaClass getPrimitiveClass(java.lang.String name)
public JavaType getArrayType(JavaType component, int dimensions)
JavaProvider
JavaType
representing the given array type of the specified component type and dimensions.getArrayType
in interface JavaProvider
component
- the component type to generate an array type fordimensions
- the array dimensions for the array typeprotected JavaType getArrayTypeImpl(java.lang.String typeKey, JavaType component, int dimensions)
typeKey
- the qualified name of the type followed by the '[]'s for the dimensioncomponent
- the java typedimensions
- the array dimensionpublic JavaPackage getPackage(java.lang.String fqName)
JavaProvider
JavaPackage
for the given fully-qualified package prefix. An empty String ("") represents the root package.getPackage
in interface JavaProvider
fqName
- Empty string means the root package.protected BaseFileProvider.BasePackage getPackageImpl(java.lang.String fqName)
protected JavaPackage getPackage(java.lang.String packagePrefix, java.lang.String name)
packagePrefix
- Should be "" for the root package.protected int getTargetJdkVersion()
protected void setTargetJdkVersion(int targetJdkVersion)
targetJdkVersion
- The target JDK version
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |