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

E17493-02

oracle.jdeveloper.java.dependency
Class JavaDeclarationProvider

java.lang.Object
  extended by oracle.jdeveloper.java.dependency.JavaDeclarationProvider
All Implemented Interfaces:
DeclarationProvider, IdDeclarationProvider

public class JavaDeclarationProvider
extends java.lang.Object
implements IdDeclarationProvider

Provides Java declarations.


Constructor Summary
JavaDeclarationProvider()
           
 
Method Summary
 boolean canGetDeclaration(Context context)
          Determine whether there could be a declaration in the context.
 boolean canGetDeclaration(Context context, java.lang.String id)
          Determine whether this provider can supply the declaration for an ID.
 boolean canGetDeclarations(Context context, Node node)
          Determine whether this provider can get declarations for a Node.
static java.lang.String getAnnotationId(java.lang.String fqClassName)
          Get the declaration ID for a Java annotation.
static java.lang.String getAnnotationName(java.lang.String id)
          Get the fully qualified Java class name for an annotation ID.
static java.lang.String getClassId(java.lang.String fqClassName)
          Get the declaration ID for a Java class.
static java.lang.String getClassName(java.lang.String id)
          Get the fully qualified Java class name for a declaration ID.
 Declaration getDeclaration(Context context)
          Get the declaration for the given context.
 IdDeclaration getDeclaration(Context context, java.lang.String id)
          Get the declaration corresponding to an ID.
 java.util.Collection<Declaration> getDeclarations(Context context, Node node)
          Get all declarations for a Node.
static java.lang.String getFieldId(java.lang.String fqClassName, java.lang.String fieldName)
          Get the declaration ID for a Java field.
static java.lang.String getFieldName(java.lang.String id)
          Get the Java field name for a declaration ID.
static java.lang.String getMethodId(java.lang.String fqClassName, java.lang.String methodName, java.lang.String... parameters)
          Get the declaration ID for a Java method.
static java.lang.String getMethodName(java.lang.String id)
          Get the Java method name for a declaration ID.
 java.util.Collection<Declaration> getTopLevelDeclarations(Context context, Node node)
          Get all top-level declarations for a Node.
static boolean isAnnotationDeclaration(java.lang.String id)
          Determine if a declaration ID is a Java annotation declaration.
static boolean isClassDeclaration(java.lang.String id)
          Determine if a declaration ID is a Java class declaration.
static boolean isFieldDeclaration(java.lang.String id)
          Determine if a declaration ID is a Java field declaration.
static boolean isJavaDeclaration(java.lang.String id)
          Determine if a declaration ID is a Java declaration.
static boolean isMethodDeclaration(java.lang.String id)
          Determine if a declaration ID is a Java method declaration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaDeclarationProvider

public JavaDeclarationProvider()
Method Detail

getAnnotationId

public static java.lang.String getAnnotationId(java.lang.String fqClassName)
Get the declaration ID for a Java annotation.

Parameters:
fqClassName - the fully qualified annotation class name
Returns:
the declaration ID for the annotation class

getClassId

public static java.lang.String getClassId(java.lang.String fqClassName)
Get the declaration ID for a Java class.

Parameters:
fqClassName - the fully qualified class name
Returns:
the declaration ID for the class

getFieldId

public static java.lang.String getFieldId(java.lang.String fqClassName,
                                          java.lang.String fieldName)
Get the declaration ID for a Java field.

Parameters:
fqClassName - the fully qualified class name
fieldName - the field name
Returns:
the declaration ID for the field

getMethodId

public static java.lang.String getMethodId(java.lang.String fqClassName,
                                           java.lang.String methodName,
                                           java.lang.String... parameters)
Get the declaration ID for a Java method.

Parameters:
fqClassName - the fully qualified class name
methodName - the method name
parameters - the fully qualified names of the parameter types
Returns:
the declaration ID for the method

getAnnotationName

public static java.lang.String getAnnotationName(java.lang.String id)
Get the fully qualified Java class name for an annotation ID.

Parameters:
id - the declaration ID
Returns:
the fully qualified class name, or null if there is no class name associated with this annotation ID

getClassName

public static java.lang.String getClassName(java.lang.String id)
Get the fully qualified Java class name for a declaration ID.

Parameters:
id - the declaration ID
Returns:
the fully qualified class name, or null if there is no class name associated with this ID

getMethodName

public static java.lang.String getMethodName(java.lang.String id)
Get the Java method name for a declaration ID.

Parameters:
id - the declaration ID
Returns:
the method name, or null if there is no method name associated with this ID

getFieldName

public static java.lang.String getFieldName(java.lang.String id)
Get the Java field name for a declaration ID.

Parameters:
id - the declaration ID
Returns:
the field name, or null if there is no field name associated with this ID

isJavaDeclaration

public static boolean isJavaDeclaration(java.lang.String id)
Determine if a declaration ID is a Java declaration.

Parameters:
id - the declaration ID
Returns:
true if the declaration ID is a Java declaration, false otherwise

isAnnotationDeclaration

public static boolean isAnnotationDeclaration(java.lang.String id)
Determine if a declaration ID is a Java annotation declaration.

Parameters:
id - the declaration ID
Returns:
true if the declaration ID is a Java annotation declaration, false otherwise

isClassDeclaration

public static boolean isClassDeclaration(java.lang.String id)
Determine if a declaration ID is a Java class declaration.

Parameters:
id - the declaration ID
Returns:
true if the declaration ID is a Java class declaration, false otherwise

isMethodDeclaration

public static boolean isMethodDeclaration(java.lang.String id)
Determine if a declaration ID is a Java method declaration.

Parameters:
id - the declaration ID
Returns:
true if the declaration ID is a Java method declaration, false otherwise

isFieldDeclaration

public static boolean isFieldDeclaration(java.lang.String id)
Determine if a declaration ID is a Java field declaration.

Parameters:
id - the declaration ID
Returns:
true if the declaration ID is a Java field declaration, false otherwise

canGetDeclaration

public boolean canGetDeclaration(Context context)
Description copied from interface: DeclarationProvider
Determine whether there could be a declaration in the context. The implementation of this method should be very fast, as it is called from the event thread to enable or disable dependency-related actions.

Specified by:
canGetDeclaration in interface DeclarationProvider
Parameters:
context - the context
Returns:
true if this provider may have a declaration in the context, false otherwise

getDeclaration

public Declaration getDeclaration(Context context)
Description copied from interface: DeclarationProvider
Get the declaration for the given context. This will only be called if DeclarationProvider.canGetDeclaration(oracle.ide.Context) returned true for this context.

Specified by:
getDeclaration in interface DeclarationProvider
Parameters:
context - the context
Returns:
the declaration

canGetDeclarations

public boolean canGetDeclarations(Context context,
                                  Node node)
Description copied from interface: DeclarationProvider
Determine whether this provider can get declarations for a Node.

Specified by:
canGetDeclarations in interface DeclarationProvider
Parameters:
context - the context
node - the Node
Returns:
true if the provider can get declarations for this Node, false otherwise

getDeclarations

public java.util.Collection<Declaration> getDeclarations(Context context,
                                                         Node node)
Description copied from interface: DeclarationProvider
Get all declarations for a Node.

Specified by:
getDeclarations in interface DeclarationProvider
Parameters:
context - the context
node - the Node
Returns:
the declarations

getTopLevelDeclarations

public java.util.Collection<Declaration> getTopLevelDeclarations(Context context,
                                                                 Node node)
Description copied from interface: DeclarationProvider
Get all top-level declarations for a Node.

Some languages have a hierarchy of declarations. Objects further down in the hierarchy can only be accessed through these top-level declarations. For example, methods in a Java class can only be referenced directly through a reference to the Java class. Or columns in a database table might only be referenced through a reference to the table. In those cases, it is possible to search for all references to a Node by searching only for the top-level declarations. This improves performance compared to searching for every declaration in the Node. Implementations that do not have such a declaration hierarchy can simply call DeclarationProvider.getDeclarations(Context,Node).

Specified by:
getTopLevelDeclarations in interface DeclarationProvider
Parameters:
context - the context
node - the Node
Returns:
the top-level declarations

canGetDeclaration

public boolean canGetDeclaration(Context context,
                                 java.lang.String id)
Description copied from interface: IdDeclarationProvider
Determine whether this provider can supply the declaration for an ID. Implementations should return true if they are responsible for this ID, regardless of whether the declaration actually exists.

Specified by:
canGetDeclaration in interface IdDeclarationProvider
Parameters:
context - the context
id - the declaration ID
Returns:
true if the provider can find the declaration

getDeclaration

public IdDeclaration getDeclaration(Context context,
                                    java.lang.String id)
                             throws java.lang.InterruptedException
Description copied from interface: IdDeclarationProvider
Get the declaration corresponding to an ID.

Specified by:
getDeclaration in interface IdDeclarationProvider
Parameters:
context - the context
id - the declaration ID
Returns:
the declaration, or null if the declaration is not found
Throws:
java.lang.InterruptedException - if the operation is interrupted

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.