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 ClassSymbol

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.ClassSymbol
All Implemented Interfaces:
JavaSyntaxCodes, Commentable, Nameable, Scope

public class ClassSymbol
extends HasModifiers
implements Commentable, Nameable, Scope

The ClassSymbol represents a class or interface declaration. Not supported yet: getComment/setComment


Field Summary
 
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.
 NameSymbol getBaseClass()
           
 TypeSymbol getBaseClassType()
           
 NameSymbol[] getBaseInterfaces()
           
 TypeSymbol[] getBaseInterfaceTypes()
           
 ClassBodySymbol getBody()
           
 CatchClause[] getCatchClauses()
           
 ClassSymbol[] getClasses()
           
 int getClassIndex()
          Retrieve the unique identifier for this ClassSymbol for this parse tree.
 CommentSymbol getComment()
          Gets the comment symbol.
 MethodSymbol[] getConstructors()
           
 Scope getEnclosingScope()
          Retrieves the most tightly enclosing scope object.
 FieldSymbol[] getFields()
           
 MemberSymbol[] getInitializers()
           
 InnerClassSymbol[] getInnerClasses()
           
 NameSymbol[] getLabels()
           
 MemberSymbol[] getMembers()
           
 MethodSymbol[] getMethods()
           
 int getModifiers()
          Gets the modifiers.
 NameSymbol getName()
          Gets the name symbol.
 int getScopeType()
          Returns the type of this scope according to the enumeration.
 VariableSymbol[] getVariables()
           
 boolean isClass()
           
 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.
 void setModifiers(int modifiers)
          Sets the modifiers.
 void setName(NameSymbol name)
          Sets the name symbol.
 
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
 

Method Detail

isClass

public boolean isClass()
Returns:
True if this is a class. False if this is an interface

getBaseClass

public NameSymbol getBaseClass()
Returns:
The NameSymbol for the base class. Null if none.

getBaseClassType

public TypeSymbol getBaseClassType()

getBody

public ClassBodySymbol getBody()

getBaseInterfaces

public NameSymbol[] getBaseInterfaces()
Returns:
The array of names for the base interfaces.

getBaseInterfaceTypes

public TypeSymbol[] getBaseInterfaceTypes()
Returns:
The array of names for the base interfaces.

getMembers

public MemberSymbol[] getMembers()
Returns:
The array of members for this class. Members include methods, fields, and constructors. Does NOT include static initializers or inner classes.

getMethods

public MethodSymbol[] getMethods()
Returns:
The array of methods for this class, not including constructors.

getFields

public FieldSymbol[] getFields()
Returns:
The array of fields for this class.

getConstructors

public MethodSymbol[] getConstructors()
Returns:
The array of constructors for this class.

getInnerClasses

public InnerClassSymbol[] getInnerClasses()
Returns:
The array of inner classes for this class.

getInitializers

public MemberSymbol[] getInitializers()
Returns:
The initializers (static or instance) for this class.

isDeprecated

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

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.

getClassIndex

public int getClassIndex()
Retrieve the unique identifier for this ClassSymbol for this parse tree.


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

getName

public NameSymbol getName()
Description copied from interface: Nameable
Gets the name symbol.

Specified by:
getName in interface Nameable
Returns:
The NameSymbol associated with this object. Null if none.

setName

public void setName(NameSymbol name)
Description copied from interface: Nameable
Sets the name symbol.

Specified by:
setName in interface Nameable

getModifiers

public int getModifiers()
Description copied from class: HasModifiers
Gets the modifiers.

Specified by:
getModifiers in interface Scope
Overrides:
getModifiers in class HasModifiers
Returns:
The modifiers associated with this object as defined by java.lang.reflect.Modifier.

setModifiers

public void setModifiers(int modifiers)
Description copied from class: HasModifiers
Sets the modifiers.

Overrides:
setModifiers in class HasModifiers

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.