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

E13403-08

oracle.javatools.parser.java.v2.util
Class Usages

java.lang.Object
  extended by oracle.javatools.parser.java.v2.internal.util.UsageHook
      extended by oracle.javatools.parser.java.v2.util.Usages

public abstract class Usages
extends oracle.javatools.parser.java.v2.internal.util.UsageHook

Tracks declarations and usages as a SourceFile is being compiled.


Constructor Summary
Usages()
           
 
Method Summary
 void declareClass(SourceClass s)
          Declares a class.
 void declareConstructor(SourceMethod s)
          Declares a constructor.
 void declareEnumConstant(SourceEnumConstant s)
          Declares an enum constant.
 void declareField(SourceFieldVariable s)
          Declares a single field that is not a enum constant.
 void declareLocalVariable(SourceLocalVariable s)
          Declares a single local variable, different from a parameter.
 void declareMethod(SourceMethod s)
          Declares a method or a constructor.
 void declareParameter(SourceFormalParameter s)
          Declares a formal parameter.
 void declareTypeParameter(SourceTypeParameter s)
          Declares a type parameter, part of a generic declaration.
 void handleDeclare(oracle.javatools.parser.java.v2.internal.symbol.Sym sym)
          For internal use only.
 void handleUsage(oracle.javatools.parser.java.v2.internal.symbol.Sym cookie, JavaElement result)
          For internal use only.
static void processUsages(SourceFile file, Usages usages)
          Causes a special compile of this file that tracks declarations and usages.
 boolean shouldTraverse(SourceElement element)
          True says "Yes, traverse (normally) the given SourceElement and its subtree as part of the compile".
 void useFieldInDocComment(SourceDocReference s, JavaField field)
          Usage of a field or enum constant in a doc comment.
 void useFieldInExpression(SourceExpression s, JavaField field)
          Usage of a field or enum constant in an expression.
 void useLocalVariableInExpression(SourceExpression s, JavaLocalVariable local)
          Usage of a local variable or formal parameter in an expression.
 void useMethodInDocComment(SourceDocReference s, JavaMethod method)
          Usage of a method or constructor in a doc comment.
 void useMethodInExpression(SourceInvokeExpression s, JavaMethod method)
          Usage of a method or constructor in an expression.
 void useParameterInDocComment(SourceDocReference s, JavaLocalVariable parameter)
          Usage of a local variable or formal parameter in an expression.
 void useParameterInExpression(SourceExpression s, JavaLocalVariable parameter)
          Usage of a local variable or formal parameter in an expression.
 void useTypeInAnnotation(SourceAnnotation s, JavaType type)
          Usage of a type in an annotation.
 void useTypeInClassExtends(SourceTypeReference s, JavaType type)
          Usage of a type as a proper supertype.
 void useTypeInCreator(SourceTypeReference s, JavaType type)
          Usage of a type in a creator expression.
 void useTypeInDocComment(SourceDocReference s, JavaType type)
          Usage of a type in a doc comment.
 void useTypeInExpression(SourceExpression s, JavaType type)
          Usage of a type in an expression that is not covered in any other category.
 void useTypeInFieldDecl(SourceTypeReference s, JavaType type)
          Usage of a type in a field declaration.
 void useTypeInInstanceof(SourceTypeReference s, JavaType type)
          Usage of a type in a field declaration.
 void useTypeInLocalVariableDecl(SourceTypeReference s, JavaType type)
          Usage of a type for a local variable.
 void useTypeInMiscellaneous(SourceTypeReference s, JavaType type)
          Usage of a type that doesn't fall into any other category.
 void useTypeInNarrowImport(SourceImport s, JavaType type)
          Usage of a type in a narrow import.
 void useTypeInParameter(SourceTypeReference s, JavaType type)
          Usage of a type as the type of a formal parameter.
 void useTypeInReturnType(SourceTypeReference s, JavaType type)
          Usage of a type as a return type of a method.
 void useTypeInThrows(SourceTypeReference s, JavaType type)
          Usage of a type as a declared exception for a method or constructor.
 void useTypeInTypecast(SourceTypeReference s, JavaType type)
          Usage of a type in a typecast expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Usages

public Usages()
Method Detail

processUsages

public static void processUsages(SourceFile file,
                                 Usages usages)
Causes a special compile of this file that tracks declarations and usages. The appropriate declare and use methods of this class are called as they occur over the course of resolution.


shouldTraverse

public boolean shouldTraverse(SourceElement element)
True says "Yes, traverse (normally) the given SourceElement and its subtree as part of the compile". False says "No, do not traverse either the given SourceElement or its subtree".

Specified by:
shouldTraverse in class oracle.javatools.parser.java.v2.internal.util.UsageHook

declareClass

public void declareClass(SourceClass s)
Declares a class.


declareConstructor

public void declareConstructor(SourceMethod s)
Declares a constructor.


declareEnumConstant

public void declareEnumConstant(SourceEnumConstant s)
Declares an enum constant.


declareField

public void declareField(SourceFieldVariable s)
Declares a single field that is not a enum constant.


declareLocalVariable

public void declareLocalVariable(SourceLocalVariable s)
Declares a single local variable, different from a parameter.


declareMethod

public void declareMethod(SourceMethod s)
Declares a method or a constructor.


declareParameter

public void declareParameter(SourceFormalParameter s)
Declares a formal parameter. Parameters may show up as part of a method's or constructor's formal parameter list and may also show up as a catch exception parameter.


declareTypeParameter

public void declareTypeParameter(SourceTypeParameter s)
Declares a type parameter, part of a generic declaration.


useFieldInDocComment

public void useFieldInDocComment(SourceDocReference s,
                                 JavaField field)
Usage of a field or enum constant in a doc comment.


useFieldInExpression

public void useFieldInExpression(SourceExpression s,
                                 JavaField field)
Usage of a field or enum constant in an expression.

Parameters:
s - Either a SourceDotExpression or a SourceSimpleNameExpression.

useLocalVariableInExpression

public void useLocalVariableInExpression(SourceExpression s,
                                         JavaLocalVariable local)
Usage of a local variable or formal parameter in an expression.

Parameters:
s - Either a SourceDotExpression or a SourceSimpleNameExpression.

useMethodInDocComment

public void useMethodInDocComment(SourceDocReference s,
                                  JavaMethod method)
Usage of a method or constructor in a doc comment.


useMethodInExpression

public void useMethodInExpression(SourceInvokeExpression s,
                                  JavaMethod method)
Usage of a method or constructor in an expression.


useParameterInDocComment

public void useParameterInDocComment(SourceDocReference s,
                                     JavaLocalVariable parameter)
Usage of a local variable or formal parameter in an expression.


useParameterInExpression

public void useParameterInExpression(SourceExpression s,
                                     JavaLocalVariable parameter)
Usage of a local variable or formal parameter in an expression.

Parameters:
s - Either a SourceDotExpression or a SourceSimpleNameExpression.

useTypeInAnnotation

public void useTypeInAnnotation(SourceAnnotation s,
                                JavaType type)
Usage of a type in an annotation.


useTypeInDocComment

public void useTypeInDocComment(SourceDocReference s,
                                JavaType type)
Usage of a type in a doc comment.


useTypeInExpression

public void useTypeInExpression(SourceExpression s,
                                JavaType type)
Usage of a type in an expression that is not covered in any other category. At the moment, this applies to simple and qualified name expressions as well as qualified-this, qualified-super, and class-literal expressions.

Parameters:
s - Either a SourceDotExpression or a SourceSimpleNameExpression.

useTypeInClassExtends

public void useTypeInClassExtends(SourceTypeReference s,
                                  JavaType type)
Usage of a type as a proper supertype. Indicates an extends or implements type reference in a class declaration. Does NOT include use as an inclusive supertype such as in a type parameter declaration.


useTypeInFieldDecl

public void useTypeInFieldDecl(SourceTypeReference s,
                               JavaType type)
Usage of a type in a field declaration.


useTypeInInstanceof

public void useTypeInInstanceof(SourceTypeReference s,
                                JavaType type)
Usage of a type in a field declaration.


useTypeInLocalVariableDecl

public void useTypeInLocalVariableDecl(SourceTypeReference s,
                                       JavaType type)
Usage of a type for a local variable.


useTypeInMiscellaneous

public void useTypeInMiscellaneous(SourceTypeReference s,
                                   JavaType type)
Usage of a type that doesn't fall into any other category.


useTypeInNarrowImport

public void useTypeInNarrowImport(SourceImport s,
                                  JavaType type)
Usage of a type in a narrow import.


useTypeInCreator

public void useTypeInCreator(SourceTypeReference s,
                             JavaType type)
Usage of a type in a creator expression.


useTypeInParameter

public void useTypeInParameter(SourceTypeReference s,
                               JavaType type)
Usage of a type as the type of a formal parameter.


useTypeInReturnType

public void useTypeInReturnType(SourceTypeReference s,
                                JavaType type)
Usage of a type as a return type of a method.


useTypeInThrows

public void useTypeInThrows(SourceTypeReference s,
                            JavaType type)
Usage of a type as a declared exception for a method or constructor.


useTypeInTypecast

public void useTypeInTypecast(SourceTypeReference s,
                              JavaType type)
Usage of a type in a typecast expression.


handleDeclare

public final void handleDeclare(oracle.javatools.parser.java.v2.internal.symbol.Sym sym)
For internal use only.

Specified by:
handleDeclare in class oracle.javatools.parser.java.v2.internal.util.UsageHook

handleUsage

public final void handleUsage(oracle.javatools.parser.java.v2.internal.symbol.Sym cookie,
                              JavaElement result)
For internal use only.

Specified by:
handleUsage in class oracle.javatools.parser.java.v2.internal.util.UsageHook

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

E13403-08

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