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 CodeElement

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.CodeElement
All Implemented Interfaces:
JavaSyntaxCodes

public class CodeElement
extends HasModifiers

A code element: a local class, a variable declaration, an expression, or a statement. It can only be an expression when it is an initialization expression for a 'for' loop. We use the term "code element" in order to follow O'Reilly's Java Reference. This class is essentially a union of the four types. Depending on the type, exactly one of getClassDefinition(), getVariables(), getExpression(), or getStatement() will return non-null.


Field Summary
static int TYPE_EXPRESSION
          This code element is an expression.
static int TYPE_LOCAL_CLASS
          This code element is a local class.
static int TYPE_STATEMENT
          This code element is a statement.
static int TYPE_UNKNOWN
          This code element is either uninitialized or has an unknown type.
static int TYPE_VARDECL
          This code element is a variable declaration.
 
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
 ClassSymbol getClassDefinition()
          Returns the class definition for this local class declaration.
 ExpressionSymbol getExpression()
          Returns the expressions symbol for this initialization of for loop.
 StatementSymbol getStatement()
          Returns the statement symbol for this statement.
 int getType()
          Returns the type of this CodeElement.
 VariableSymbol[] getVariables()
          Returns the variables declared in this local variable declaration.
 
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
 

Field Detail

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN
This code element is either uninitialized or has an unknown type.

See Also:
Constant Field Values

TYPE_LOCAL_CLASS

public static final int TYPE_LOCAL_CLASS
This code element is a local class. Retrieve the class definition via getClassDefinition(). To determine whether or not the class has been declared final, call ClassSymbol.getModifiers() on the class symbol.

See Also:
Constant Field Values

TYPE_VARDECL

public static final int TYPE_VARDECL
This code element is a variable declaration. Retrieve the variable declarations via getVariables(). To determine whether or not the variable has been declared final, call VariableSymbol.getModifiers() on the first variable.

See Also:
Constant Field Values

TYPE_STATEMENT

public static final int TYPE_STATEMENT
This code element is a statement. Retrieve the statement via getStatement().

See Also:
Constant Field Values

TYPE_EXPRESSION

public static final int TYPE_EXPRESSION
This code element is an expression. Note that this is only used in the for statement for the init expressions.

See Also:
Constant Field Values
Method Detail

getType

public int getType()
Returns the type of this CodeElement.

Returns:
the type of this code element. See enumerated constants below.

getClassDefinition

public ClassSymbol getClassDefinition()
Returns the class definition for this local class declaration.

Returns:
the ClassSymbol associated with this CodeElement. Non-null if this is of type TYPE_LOCAL_CLASS.

getVariables

public VariableSymbol[] getVariables()
Returns the variables declared in this local variable declaration.

Returns:
the array of VariableSymbols associated with this CodeElement. Non-null if this is of type TYPE_VARDECL.

getStatement

public StatementSymbol getStatement()
Returns the statement symbol for this statement.

Returns:
the StatementSymbol associated with this CodeElement. Non-null if this is of type TYPE_STATEMENT.

getExpression

public ExpressionSymbol getExpression()
Returns the expressions symbol for this initialization of for loop.

Returns:
the ExpressionSymbol associated with this CodeElement. Non-null if this is of type TYPE_EXPRESSION.

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.