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
Class MemberSymbol

java.lang.Object
  extended by oracle.javatools.parser.util.ArrayListHeap
      extended by oracle.javatools.parser.java.v1.symbol.JavaSymbol
          extended by oracle.javatools.parser.java.v1.symbol.HasModifiers
              extended by oracle.javatools.parser.java.v1.symbol.MemberSymbol
All Implemented Interfaces:
JavaSyntaxCodes, Commentable, Scope
Direct Known Subclasses:
FieldSymbol, InnerClassSymbol, MethodSymbol

public class MemberSymbol
extends HasModifiers
implements Scope, Commentable

The MemberSymbol represents a class member declaration.

Not supported yet: getType, Commentable interface


Field Summary
static int CONSTRUCTOR
          This member is a MethodSymbol representing a constructor.
static MemberSymbol[] EMPTY_ARRAY
           
static int FIELD
          This member is a FieldSymbol representing a field.
static int INITIALIZER
          This member is a MemberSymbol representing an initializer, static or instance.
static int INNER_CLASS
          This member is an InnerClassSymbol representing either an inner class or an inner interface.
static int METHOD
          This member is a MethodSymbol representing a method.
 
Fields inherited from interface oracle.javatools.parser.java.v1.symbol.Scope
SCOPE_BLOCK, SCOPE_CATCH, SCOPE_CLASS, SCOPE_MEMBER, SCOPE_METHOD, SCOPE_ROOT, SCOPE_STATEMENT, SCOPE_TRY
 
Fields inherited from interface oracle.javatools.parser.java.v1.JavaSyntaxCodes
SYNTAX_ARGUMENTS, SYNTAX_ARRAY_CREATOR, SYNTAX_ARRAY_INITIALIZER, SYNTAX_ASG_OPERATOR, SYNTAX_BLOCK, SYNTAX_BRACKET_EXPRESSION, SYNTAX_BRACKETS_OPT, SYNTAX_BROKEN, SYNTAX_CATCH_CLAUSE, SYNTAX_CATCH_PAREN_EXPRESSION, SYNTAX_CLASS_CREATOR, SYNTAX_CLASS_DECLARATION, SYNTAX_CLASS_INITIALIZER, SYNTAX_CODE_ELEMENT, SYNTAX_CONSTRUCTOR_DECLARATION, SYNTAX_CONTROL_PAREN_EXPRESSION, SYNTAX_CREATOR, SYNTAX_DO_STATEMENT, SYNTAX_DOC_COMMENT, SYNTAX_ELSE_CLAUSE, SYNTAX_EXP_WRAPPER, SYNTAX_EXPRESSION, SYNTAX_EXPRESSION_OR_DECL, SYNTAX_EXTENDS, SYNTAX_FIELD_DECLARATION, SYNTAX_FINALLY_CLAUSE, SYNTAX_FOR_CONDITIONAL, SYNTAX_FOR_INIT, SYNTAX_FOR_PAREN_EXPRESSION, SYNTAX_FOR_STATEMENT, SYNTAX_FOR_UPDATE, SYNTAX_FORMAL_PARAMETER, SYNTAX_FORMAL_PARAMETER_LIST, SYNTAX_IDENTIFIER_PRIMARY, SYNTAX_IF_STATEMENT, SYNTAX_IMPLEMENTS, SYNTAX_IMPORT_DECLARATION, SYNTAX_INFIX_OPERATOR, SYNTAX_INIT_ARRAY_CREATOR, SYNTAX_INNER_CLASS_OR_INTERFACE, SYNTAX_INNER_CREATOR, SYNTAX_INTERFACE_DECLARATION, SYNTAX_JAVA_ROOT, SYNTAX_MEMBER_DECLARATION, SYNTAX_METHOD_DECLARATION, SYNTAX_MODIFIERS, SYNTAX_PACKAGE_DECLARATION, SYNTAX_PAREN_EXPRESSION, SYNTAX_POSTFIX_OPERATOR, SYNTAX_PREFIX_OPERATOR, SYNTAX_PRIMARY, SYNTAX_PRIMARY_BRACKETS, SYNTAX_PRIMARY_WORD, SYNTAX_QUALIFIED_IMPORT_NAME, SYNTAX_QUALIFIED_NAME, SYNTAX_QUALIFIED_PRIMARY, SYNTAX_QUES_OPERATOR, SYNTAX_SIMPLE_NAME, SYNTAX_SQLJ_CONTEXT, SYNTAX_SQLJ_STATEMENT, SYNTAX_STATEMENT, SYNTAX_SWITCH_BLOCK, SYNTAX_SWITCH_CASE, SYNTAX_SWITCH_STATEMENT, SYNTAX_SYNCH_STATEMENT, SYNTAX_THROWS, SYNTAX_TRY_STATEMENT, SYNTAX_TYPE, SYNTAX_TYPE_BODY, SYNTAX_TYPE_DECLARATION, SYNTAX_UNINIT_ARRAY_CREATOR, SYNTAX_UNPARSED_BLOCK, SYNTAX_UNPARSED_EXPRESSION, SYNTAX_UNPARSED_PAREN_EXPRESSION, SYNTAX_VARIABLE_DECLARATOR, SYNTAX_VARIABLE_INITIALIZER, SYNTAX_WHILE_STATEMENT
 
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.
 CodeBlockSymbol getBlock()
          Gets the code block associated with this member.
 CatchClause[] getCatchClauses()
           
 ClassSymbol[] getClasses()
           
 CommentSymbol getComment()
          Gets the comment symbol.
 Scope getEnclosingScope()
          Retrieves the most tightly enclosing scope object.
 NameSymbol[] getLabels()
           
 ClassSymbol[] getLocalClasses()
          Gets all local and anonymous classes declared in this member.
 int getScopeType()
          Returns the type of this scope according to the enumeration.
 VariableSymbol[] getVariables()
           
 boolean isDeprecated()
           
 boolean isHidden()
           
 void setComment(CommentSymbol comment)
          Sets the comment symbol.
 void setEnclosingScope(Scope scope)
          Sets the enclosing scope to the given Scope object.
 int whatAmI()
           
 
Methods inherited from class oracle.javatools.parser.java.v1.symbol.HasModifiers
getModifiers, setModifiers
 
Methods inherited from class oracle.javatools.parser.java.v1.symbol.JavaSymbol
getCode, getEndOffset, getParent, getStartOffset
 
Methods inherited from class oracle.javatools.parser.util.ArrayListHeap
allocArrayList, freeArrayList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.javatools.parser.java.v1.symbol.Scope
getModifiers
 

Field Detail

EMPTY_ARRAY

public static final MemberSymbol[] EMPTY_ARRAY

METHOD

public static final int METHOD
This member is a MethodSymbol representing a method. getBlock() returns the method's body if this is not an abstract method.

See Also:
Constant Field Values

CONSTRUCTOR

public static final int CONSTRUCTOR
This member is a MethodSymbol representing a constructor. getBlock() returns the constructor's body.

See Also:
Constant Field Values

FIELD

public static final int FIELD
This member is a FieldSymbol representing a field. getBlock() returns null.

See Also:
Constant Field Values

INNER_CLASS

public static final int INNER_CLASS
This member is an InnerClassSymbol representing either an inner class or an inner interface. getBlock() returns null.

See Also:
Constant Field Values

INITIALIZER

public static final int INITIALIZER
This member is a MemberSymbol representing an initializer, static or instance. To determine if it is static, you'll need to check the getModifiers(). getBlock() returns a non-null code block.

See Also:
Constant Field Values
Method Detail

whatAmI

public int whatAmI()
Returns:
an enumeration specifying what kind of member this is. See the public constants.

getBlock

public CodeBlockSymbol getBlock()
Gets the code block associated with this member. This will only return non-null for non-abstract methods, constructors, and static initializers.

Returns:
the code block associated with this member

getLocalClasses

public ClassSymbol[] getLocalClasses()
Gets all local and anonymous classes declared in this member.

Returns:
the array of local classes. Unlike elsewhere, this WILL return a null array if there are no local classes.

isDeprecated

public boolean isDeprecated()
Returns:
True if the Javadoc for this class symbol indicates that it is deprecated. False if this is an initializer because in Java, initializers may not be deprecated. Otherwise, false.

isHidden

public boolean isHidden()
Returns:
True if the Javadoc for this class symbol indicates that it is deprecated. False otherwise.

getScopeType

public 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.

Specified by:
getScopeType in interface Scope

getEnclosingScope

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

Specified by:
getEnclosingScope in interface Scope

setEnclosingScope

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

Specified by:
setEnclosingScope in interface Scope

findLabel

public boolean findLabel(java.lang.String name)
Description copied from interface: Scope
Note that only STATEMENT scopes may return true for findLabel. Memory-efficient operation.

Specified by:
findLabel in interface Scope
Returns:
True if the given label applies to this scope instance.

findVariable

public 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.

Specified by:
findVariable in interface Scope

findType

public 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.

Specified by:
findType in interface Scope

getLabels

public NameSymbol[] getLabels()
Specified by:
getLabels in interface Scope
Returns:
Retrieves all labels. Only STATEMENT scopes should a non-zero length array here.

getVariables

public VariableSymbol[] getVariables()
Specified by:
getVariables in interface Scope
Returns:
Retrieves all variables at this scope.

getClasses

public ClassSymbol[] getClasses()
Specified by:
getClasses in interface Scope
Returns:
Retrieves all classes at this scope.

getCatchClauses

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

getComment

public CommentSymbol getComment()
Description copied from interface: Commentable
Gets the comment symbol.

Specified by:
getComment in interface Commentable
Returns:
The CommentSymbol associated with this object. Null if none.

setComment

public void setComment(CommentSymbol comment)
Description copied from interface: Commentable
Sets the comment symbol.

Specified by:
setComment in interface Commentable

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.