Extension SDK 9.0.5

oracle.jdeveloper.jot
Interface JotStatement

All Superinterfaces:
JotBlockElement, JotCodeElement, JotElement
All Known Subinterfaces:
JotBlockStatement, JotBreak, JotCase, JotConditional, JotContinue, JotDo, JotElse, JotExpressionStatement, JotFor, JotHasChildStatement, JotIf, JotReturn, JotSwitch, JotSynchronized, JotThrow, JotTry, JotWhile

public interface JotStatement
extends JotBlockElement

The JotStatement interface represents a statement in a Java source file. Statements fall into one of 15 types; the getStatementType method can be used to determine the type of a JotStatement.

Since:
5.0
See Also:
"Section 14 of the Java Language Specification"

Field Summary
static int BLOCK_STATEMENT
          The statement type for code blocks.
static int BREAK_STATEMENT
          The statement type for break statements
static int CASE_CLAUSE
          The statement type for case clauses.
static int CONTINUE_STATEMENT
          The statement type for continue statements
static int DO_STATEMENT
          The statement type for do statements
static int ELSE_CLAUSE
          The statement type for else clauses.
static int EMPTY_STATEMENT
          The statement for an empty statement.
static int EXPRESSION_STATEMENT
          The statement type for expression statements
static int FOR_STATEMENT
          The statement type for for statements
static int IF_STATEMENT
          The statement type for if statements
static int RETURN_STATEMENT
          The statement type for return statements
static int SWITCH_STATEMENT
          The statement type for switch statements
static int SYNCHRONIZED_STATEMENT
          The statement type for synchronized statements
static int THROW_STATEMENT
          The statement type for throw statements
static int TRY_STATEMENT
          The statement type for try statements
static int WHILE_STATEMENT
          The statement type for while statements
 
Fields inherited from interface oracle.jdeveloper.jot.JotBlockElement
LOCAL_CLASS_TYPE, STATEMENT_TYPE, VARIABLE_DECLARATION_TYPE
 
Method Summary
 void addLabel(java.lang.String label)
          Add a label to this statement.
 JotBlockStatement getAsBlock()
          Retrieves the JotBlockStatement representing this statement if it is a block statement.
 JotBreak getAsBreak()
          Retrieves the JotBreak representing this statement if it is a break statement.
 JotCase getAsCase()
          Retrieves the JotCase representing this statement if it is a case statement.
 JotContinue getAsContinue()
          Retrieves the JotContinue representing this statement if it is a continue statement.
 JotDo getAsDo()
          Retrieves the JotConditional representing this statement if it is a do statement.
 JotExpressionStatement getAsExpressionStatement()
          Retrieves the JotExpressionStatement representing this statement if it is an expression statement.
 JotFor getAsFor()
          Retrieves the JotFor representing this statement if it is a for statement.
 JotIf getAsIf()
          Retrieves the JotIf representing this statement if it is an if statement.
 JotReturn getAsReturn()
          Retrieves the JotReturn representing this statement if it is a return statement.
 JotSwitch getAsSwitch()
          Retrieves the JotSwitch representing this statement if it is a switch statement.
 JotSynchronized getAsSynchronized()
          Retrieves the JotSynchronized representing this statement if it is a synchronized statement.
 JotThrow getAsThrow()
          Retrieves the JotThrow representing this statement if it is a throw statement.
 JotTry getAsTry()
          Retrieves the JotTry representing this statement if it is a try statement.
 JotWhile getAsWhile()
          Retrieves the JotConditional representing this statement if it is a while statement.
 java.lang.String[] getLabels()
          Retrieves the labels associated with this statement.
 java.lang.String getStatementText()
          Retrieves the text representation of this JotStatement.
 int getStatementType()
          Retrieves the statement type of this JotStatement.
 void removeLabel(java.lang.String label)
          Removes a label from a statement.
 
Methods inherited from interface oracle.jdeveloper.jot.JotBlockElement
getAsLocalClass, getAsStatement, getAsVariableDeclaration, getElementType
 
Methods inherited from interface oracle.jdeveloper.jot.JotCodeElement
addPrecedingComment, childrenContainErrors, delete, getContainingJotFile, getLeftWhitespace, getLength, getRightWhitespace, isInError, isSource, setLeftWhitespace, setRightWhitespace
 
Methods inherited from interface oracle.jdeveloper.jot.JotElement
getChildren, getContainedElements, getElementName, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent
 

Field Detail

BLOCK_STATEMENT

public static final int BLOCK_STATEMENT
The statement type for code blocks.

See Also:
Constant Field Values

EXPRESSION_STATEMENT

public static final int EXPRESSION_STATEMENT
The statement type for expression statements

See Also:
Constant Field Values

IF_STATEMENT

public static final int IF_STATEMENT
The statement type for if statements

See Also:
Constant Field Values

SWITCH_STATEMENT

public static final int SWITCH_STATEMENT
The statement type for switch statements

See Also:
Constant Field Values

WHILE_STATEMENT

public static final int WHILE_STATEMENT
The statement type for while statements

See Also:
Constant Field Values

DO_STATEMENT

public static final int DO_STATEMENT
The statement type for do statements

See Also:
Constant Field Values

FOR_STATEMENT

public static final int FOR_STATEMENT
The statement type for for statements

See Also:
Constant Field Values

BREAK_STATEMENT

public static final int BREAK_STATEMENT
The statement type for break statements

See Also:
Constant Field Values

CONTINUE_STATEMENT

public static final int CONTINUE_STATEMENT
The statement type for continue statements

See Also:
Constant Field Values

RETURN_STATEMENT

public static final int RETURN_STATEMENT
The statement type for return statements

See Also:
Constant Field Values

THROW_STATEMENT

public static final int THROW_STATEMENT
The statement type for throw statements

See Also:
Constant Field Values

TRY_STATEMENT

public static final int TRY_STATEMENT
The statement type for try statements

See Also:
Constant Field Values

SYNCHRONIZED_STATEMENT

public static final int SYNCHRONIZED_STATEMENT
The statement type for synchronized statements

See Also:
Constant Field Values

CASE_CLAUSE

public static final int CASE_CLAUSE
The statement type for case clauses. Note that a case clause is not strictly a statement; however, JOT treats it as a statement for convenience.

See Also:
Constant Field Values

ELSE_CLAUSE

public static final int ELSE_CLAUSE
The statement type for else clauses. Note that an else clause is not strictly a statement; however, JOT treats it as a statement for convenience.

See Also:
Constant Field Values

EMPTY_STATEMENT

public static final int EMPTY_STATEMENT
The statement for an empty statement. An empty statement is a statement without any text (just a semi-colon). An empty statement does not have a corresponding getAs... method.

See Also:
Constant Field Values
Method Detail

getStatementText

public java.lang.String getStatementText()
                                  throws JotInvalidElementException
Retrieves the text representation of this JotStatement. The text includes all expressions and sub-statements.

Returns:
the text representation of this JotStatement.
Throws:
JotInvalidElementException

getLabels

public java.lang.String[] getLabels()
                             throws JotInvalidElementException
Retrieves the labels associated with this statement. Statements can have one or more optional labels, which must be valid identifiers.

Returns:
the labels associated with this statement, or a zero-length array if no labels are defined.
Throws:
JotInvalidElementException

addLabel

public void addLabel(java.lang.String label)
              throws JotInvalidElementException
Add a label to this statement.

Parameters:
label - the new label to add to this statement
Throws:
JotInvalidElementException

removeLabel

public void removeLabel(java.lang.String label)
                 throws JotInvalidElementException
Removes a label from a statement.

Parameters:
label - the label to remove
Throws:
JotInvalidElementException

getStatementType

public int getStatementType()
                     throws JotInvalidElementException
Retrieves the statement type of this JotStatement.

Returns:
the statement type.
Throws:
JotInvalidElementException

getAsBlock

public JotBlockStatement getAsBlock()
                             throws JotInvalidElementException
Retrieves the JotBlockStatement representing this statement if it is a block statement.

Returns:
a JotBlockStatement instance if this statement is a block statement, or null otherwise.
Throws:
JotInvalidElementException

getAsExpressionStatement

public JotExpressionStatement getAsExpressionStatement()
                                                throws JotInvalidElementException
Retrieves the JotExpressionStatement representing this statement if it is an expression statement.

Returns:
a JotExpressionStatement instance if this statement is an expression statement, or null otherwise.
Throws:
JotInvalidElementException

getAsIf

public JotIf getAsIf()
Retrieves the JotIf representing this statement if it is an if statement.

Returns:
a JotIf instance if this statement is an if statement, or null otherwise.

getAsSwitch

public JotSwitch getAsSwitch()
Retrieves the JotSwitch representing this statement if it is a switch statement.

Returns:
a JotSwitch instance if this statement is a switch statement, or null otherwise.

getAsWhile

public JotWhile getAsWhile()
Retrieves the JotConditional representing this statement if it is a while statement.

Returns:
a JotConditional instance if this statement is a while statement, or null otherwise.

getAsDo

public JotDo getAsDo()
Retrieves the JotConditional representing this statement if it is a do statement.

Returns:
a JotConditional instance if this statement is a do statement, or null otherwise.

getAsFor

public JotFor getAsFor()
Retrieves the JotFor representing this statement if it is a for statement.

Returns:
a JotFor instance if this statement is a for statement, or null otherwise.

getAsBreak

public JotBreak getAsBreak()
Retrieves the JotBreak representing this statement if it is a break statement.

Returns:
a JotBreak instance if this statement is a break statement, or null otherwise.

getAsContinue

public JotContinue getAsContinue()
Retrieves the JotContinue representing this statement if it is a continue statement.

Returns:
a JotContinue instance if this statement is a continue statement, or null otherwise.

getAsReturn

public JotReturn getAsReturn()
Retrieves the JotReturn representing this statement if it is a return statement.

Returns:
a JotReturn instance if this statement is a return statement, or null otherwise.

getAsThrow

public JotThrow getAsThrow()
Retrieves the JotThrow representing this statement if it is a throw statement.

Returns:
a JotThrow instance if this statement is a throw statement, or null otherwise.

getAsTry

public JotTry getAsTry()
Retrieves the JotTry representing this statement if it is a try statement.

Returns:
a JotTry instance if this statement is a try statement, or null otherwise.

getAsSynchronized

public JotSynchronized getAsSynchronized()
Retrieves the JotSynchronized representing this statement if it is a synchronized statement.

Returns:
a JotSynchronized instance if this statement is a synchronized statement, or null otherwise.

getAsCase

public JotCase getAsCase()
Retrieves the JotCase representing this statement if it is a case statement.

Returns:
a JotCase instance if this statement is a case statement, or null otherwise.

Extension SDK

 

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