|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.6.0) E13403-07 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JavaProvider
The JavaProvider
interface defines the requirements of
the compiler for retrieving class information. Clients may provide
implementations of the JavaProvider if they would like to provide
customize class information.
This is essentially a class loader with an API customized for the compiler implementation.
The comments describing the interface methods describe the requirements that an implementation must satisfy in order to work properly with the compiler.
Method Summary | |
---|---|
JavaType |
getArrayType(JavaType componentType,
int dimensions)
Fetch the JavaType representing the given array type
of the specified component type and dimensions. |
JavaClass |
getClass(java.lang.String fqName)
Fetch the JavaClass for the given fully-qualified type
name in dotted notation. |
JavaClass |
getClass(java.lang.String fqPrefix,
java.lang.String name)
Fetch the JavaClass for the given qualified class. |
JavaClass |
getClassByVMName(java.lang.String fqVmName)
Fetch the JavaClass for the specified fully-qualified
type name in VM notation. |
JavaPackage |
getPackage(java.lang.String fqPrefix)
Fetch the JavaPackage for the given fully-qualified
package prefix. |
SourceClass |
getSourceClass(java.lang.String fqName)
Fetch the SourceClass for the fully-qualified class
name. |
TextBuffer |
getTextBuffer(java.net.URL url)
Fetch a TextBuffer instance for the specified URL. |
Method Detail |
---|
JavaClass getClass(java.lang.String fqName)
JavaClass
for the given fully-qualified type
name in dotted notation. The type may denote a primitive type, or
a class type.
If the qualified name specified represents a primitive type, then
the implementer is required to return the canonical
PrimitiveType
instance. PrimitiveType
is
in the "common" subpackage and implementers can get the correct one
by calling CommonUtilities.getPrimitiveType( String )
.
If the qualified name specified 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.
For class types, implementations are required to perform left-to-right class resolution.
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.
fqName
- the fully-qualified type name in dotted notation, such
as "java.lang.Object" or "java.util.Map.Entry"
JavaClass getClass(java.lang.String fqPrefix, java.lang.String name)
JavaClass
for the given qualified class.
This is similar to getClass( String fqName )
except
that it splits out the fully-qualified prefix and class name
for convenience.
Implementations can concatenate the fqPrefix and name together
and just rely on the getClass( String fqName )
method.
fqPrefix
- the fully-qualified prefixname
- the name of the class
JavaClass getClassByVMName(java.lang.String fqVmName)
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.
fqRawName
- the fully-qualified type name (different from the
qualified source name and different from the descriptor) in
VM notation, such as "java/lang/Object" or
"java/util/Map$Entry"
JavaType getArrayType(JavaType componentType, int dimensions)
JavaType
representing the given array type
of the specified component type and dimensions.
componentType
- the component type to generate an array type
fordimensions
- the array dimensions for the array type
java.lang.IllegalArgumentException
- if the dimensions are invalid,
i.e., negativeSourceClass getSourceClass(java.lang.String fqName)
SourceClass
for the fully-qualified class
name. The name must represent a class type. Implementations must
base the class information on Java source (*.java) content.
Similar to getClass( String fqName )
, implementations
must perform left-to-right package/class resolution.
fqName
- the fully-qualified type name in dotted notation, such
as "java.lang.Object" or "java.util.Map.Entry"
JavaPackage getPackage(java.lang.String fqPrefix)
JavaPackage
for the given fully-qualified
package prefix. An empty String ("") represents the root package.
fqPrefix
- the fully-qualified package prefix, such as
"java.io" or "javax.swing.text"
TextBuffer getTextBuffer(java.net.URL url)
TextBuffer
instance for the specified URL.
This is used currently for parsing and resolving a SourceFile.
This method may be removed in the future.
url
- the URL to fetch the TextBuffer for
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.6.0) E13403-07 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |