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

E13403-02

oracle.javatools.parser.java.v1.symbol
Interface Scope

All Known Implementing Classes:
CatchClause, ClassSymbol, CodeBlockSymbol, ControlStatement, FieldSymbol, ForStatement, InnerClassSymbol, MemberSymbol, MethodSymbol, RootSymbol, SqlStatement, StatementSymbol, TryStatement

public interface Scope


Field Summary
static int SCOPE_BLOCK
          This scope is a CodeBlockSymbol.
static int SCOPE_CATCH
          This scope is a CatchClause.
static int SCOPE_CLASS
          This scope is a ClassSymbol.
static int SCOPE_MEMBER
          This scope is a MemberSymbol that is NOT a MethodSymbol.
static int SCOPE_METHOD
          This scope is a MethodSymbol.
static int SCOPE_ROOT
          This scope is a RootSymbol.
static int SCOPE_STATEMENT
          This scope is a StatementSymbol that is NOT a CatchClause.
static int SCOPE_TRY
          This scope is a TryStatement.
 
Method Summary
 boolean findLabel(java.lang.String name)
          Note that only STATEMENT scopes may return true for findLabel.
 ClassSymbol findType(java.lang.String name)
          If this scope contains local classes or declared member inner classes, check to see if one exists that matches the given name.
 VariableSymbol findVariable(java.lang.String name)
          If this scope contains local variables, method parameters, or declared member fields, check to see if one exists that matches the given name.
 CatchClause[] getCatchClauses()
           
 ClassSymbol[] getClasses()
           
 Scope getEnclosingScope()
          Retrieves the most tightly enclosing scope object.
 NameSymbol[] getLabels()
           
 int getModifiers()
          If this is a ClassSymbol or a MemberSymbol, return the modifiers.
 int getScopeType()
          Returns the type of this scope according to the enumeration.
 VariableSymbol[] getVariables()
           
 void setEnclosingScope(Scope scope)
          Sets the enclosing scope to the given Scope object.
 

Field Detail

SCOPE_ROOT

static final int SCOPE_ROOT
This scope is a RootSymbol.

See Also:
Constant Field Values

SCOPE_CLASS

static final int SCOPE_CLASS
This scope is a ClassSymbol.

See Also:
Constant Field Values

SCOPE_MEMBER

static final int SCOPE_MEMBER
This scope is a MemberSymbol that is NOT a MethodSymbol.

See Also:
Constant Field Values

SCOPE_METHOD

static final int SCOPE_METHOD
This scope is a MethodSymbol.

See Also:
Constant Field Values

SCOPE_BLOCK

static final int SCOPE_BLOCK
This scope is a CodeBlockSymbol.

See Also:
Constant Field Values

SCOPE_STATEMENT

static final int SCOPE_STATEMENT
This scope is a StatementSymbol that is NOT a CatchClause.

See Also:
Constant Field Values

SCOPE_TRY

static final int SCOPE_TRY
This scope is a TryStatement.

See Also:
Constant Field Values

SCOPE_CATCH

static final int SCOPE_CATCH
This scope is a CatchClause.

See Also:
Constant Field Values
Method Detail

getScopeType

int getScopeType()
Returns the type of this scope according to the enumeration. Yes, this is kind of redundant, but it's much faster than an if-else instanceof test.


getEnclosingScope

Scope getEnclosingScope()
Retrieves the most tightly enclosing scope object.


setEnclosingScope

void setEnclosingScope(Scope scope)
Sets the enclosing scope to the given Scope object.


getModifiers

int getModifiers()
If this is a ClassSymbol or a MemberSymbol, return the modifiers. Else return zero.


findLabel

boolean findLabel(java.lang.String name)
Note that only STATEMENT scopes may return true for findLabel. Memory-efficient operation.

Returns:
True if the given label applies to this scope instance.

findVariable

VariableSymbol findVariable(java.lang.String name)
If this scope contains local variables, method parameters, or declared member fields, check to see if one exists that matches the given name. If yes, return it. Return null otherwise. Memory-efficient operation.


findType

ClassSymbol findType(java.lang.String name)
If this scope contains local classes or declared member inner classes, check to see if one exists that matches the given name. If yes, return it. Return null otherwise. Fast operation. Memory-efficient operation.


getLabels

NameSymbol[] getLabels()
Returns:
Retrieves all labels. Only STATEMENT scopes should a non-zero length array here.

getVariables

VariableSymbol[] getVariables()
Returns:
Retrieves all variables at this scope.

getClasses

ClassSymbol[] getClasses()
Returns:
Retrieves all classes at this scope.

getCatchClauses

CatchClause[] getCatchClauses()
Returns:
Retrieves all catch clauses. Only TRY scopes should return a non-zero length array here.

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

E13403-02

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