Extension SDK

oracle.jdeveloper.jot
Interface JotExpression

All Superinterfaces:
JotElement
All Known Subinterfaces:
JotAllocation, JotAnonymousClass, JotArrayAllocation, JotArrayDereference, JotArrayInitializer, JotAssignment, JotClassAllocation, JotInfixExpression, JotMethodCall, JotNestedExpression, JotPostIncrementOrDecrement, JotPreIncrementOrDecrement, JotPrimaryExpression, JotQuestionExpression, JotStatementExpression, JotTypecast, JotUnaryExpression

public interface JotExpression
extends JotElement

A JotExpression represents a Java expression. An expression can fall into at most one of fourteen expression types. Calling getExpressionType will return the type of the expression. Additionally, the methods getAsXXX will return the expression as the type XXX if the expression is of that type, or null otherwise. Only one of the getAsXXX methods will return a non-null value for any given expression.

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

Field Summary
static int ANONYMOUS_CLASS_ALLOCATION_EXPRESSION
          ID value representing an allocation of a new anonymous class instance.
static int ARRAY_ALLOCATION_EXPRESSION
          ID value representing an allocation of a new array.
static int ARRAY_DEREFERENCE_EXPRESSION
          ID value representing an array initializer expression.
static int ARRAY_INITIALIZER_EXPRESSION
          ID value representing an array initializer expression.
static int ASSIGNMENT_EXPRESSION
          ID value representing an assignment.
static int CLASS_ALLOCATION_EXPRESSION
          ID value representing an allocation of a new class instance.
static int INFIX_EXPRESSION
          ID value representing an infix expression.
static int METHOD_CALL_EXPRESSION
          ID value representing method call.
static int NESTED_EXPRESSION
          ID value representing a nested expression.
static int POST_INC_OR_DEC_EXPRESSION
          ID value representing a post increment or decrement.
static int PRE_INC_OR_DEC_EXPRESSION
          ID value representing a pre increment or decrement.
static int PRIMARY_EXPRESSION
          ID value representing a primary expression.
static int QUESTION_EXPRESSION
          ID value representing a question expression.
static int TYPECAST_EXPRESSION
          ID value representing a typecast.
static int UNARY_EXPRESSION
          ID value representing a unary expression.
static int UNCATEGORIZED_EXPRESSION
          ID value representing an arbitrary expression.
 
Method Summary
 JotAnonymousClass getAsAnonymousClass()
          Retrieves the JotAnonymousClass representing this expression if it is an anonymous class declaration.
 JotArrayAllocation getAsArrayAllocation()
          Retrieves the JotArrayAllocation representing this expression if it is an array allocation.
 JotArrayDereference getAsArrayDereference()
          Retrieves the JotArrayDereference representing this expression if it is an array dereference expression.
 JotArrayInitializer getAsArrayInitializer()
          Retrieves the JotArrayInitializer representing this expression if it is an array initializer expression.
 JotAssignment getAsAssignment()
          Retrieves the JotAssignment representing this expression if it is an assignment.
 JotClassAllocation getAsClassAllocation()
          Retrieves the JotClassAllocation representing this expression if it is a class allocation.
 JotInfixExpression getAsInfixExpression()
          Retrieves the JotInfixExpression representing this expression if it is an infix expression.
 JotMethodCall getAsMethodCall()
          Retrieves the JotMethodCall representing this expression if it is a method call.
 JotNestedExpression getAsNestedExpression()
          Retrieves the JotNestedExpression representing this expression if it is a nested expression.
 JotPostIncrementOrDecrement getAsPostIncrementOrDecrement()
          Retrieves the JotPostIncrementOrDecrement representing this expression if it is a post increment or decrement expression.
 JotPreIncrementOrDecrement getAsPreIncrementOrDecrement()
          Retrieves the JotPreIncrementOrDecrement representing this expression if it is a pre increment or decrement expression.
 JotPrimaryExpression getAsPrimaryExpression()
          Retrieves the JotPrimaryExpression representing this expression if it is a primary expression.
 JotQuestionExpression getAsQuestionExpression()
          Retrieves the JotQuestionExpression representing this expression if it is a question expression.
 JotTypecast getAsTypecast()
          Retrieves the JotTypecast representing this expression if it is a typecast.
 JotUnaryExpression getAsUnaryExpression()
          Retrieves the JotUnaryExpression representing this expression if it is a unary expression.
 java.lang.String getExpressionString()
          Retrieves the string representation of this expression.
 int getExpressionType()
          Retrieves the kind of expression represented by this JotExpression.
 java.lang.String getMinimumReferenceName(java.lang.String type)
          Retrieves the minimum name required to reference the specified type, based on the current scope.
 boolean isParenthesized()
          Whether this expression is enclosed within parenthesis.
 void renameObjectReference(java.lang.String oldName, java.lang.String newName)
          Renames any occurrences of a given object name to another name.
 JotType resolveTypeReference(java.lang.String type)
          Resolves a type name into a JotType, based on the current scope.
 void setParenthesized(boolean isParenthesized)
          Sets the parenthesis state of this expression.
 
Methods inherited from interface oracle.jdeveloper.jot.JotElement
getElementName, getElementType, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent
 

Field Detail

UNCATEGORIZED_EXPRESSION

public static final int UNCATEGORIZED_EXPRESSION
ID value representing an arbitrary expression.

See Also:
Constant Field Values

METHOD_CALL_EXPRESSION

public static final int METHOD_CALL_EXPRESSION
ID value representing method call.

See Also:
Constant Field Values

ASSIGNMENT_EXPRESSION

public static final int ASSIGNMENT_EXPRESSION
ID value representing an assignment.

See Also:
Constant Field Values

CLASS_ALLOCATION_EXPRESSION

public static final int CLASS_ALLOCATION_EXPRESSION
ID value representing an allocation of a new class instance.

See Also:
Constant Field Values

ARRAY_ALLOCATION_EXPRESSION

public static final int ARRAY_ALLOCATION_EXPRESSION
ID value representing an allocation of a new array.

See Also:
Constant Field Values

ANONYMOUS_CLASS_ALLOCATION_EXPRESSION

public static final int ANONYMOUS_CLASS_ALLOCATION_EXPRESSION
ID value representing an allocation of a new anonymous class instance.

See Also:
Constant Field Values

NESTED_EXPRESSION

public static final int NESTED_EXPRESSION
ID value representing a nested expression.

See Also:
Constant Field Values

ARRAY_INITIALIZER_EXPRESSION

public static final int ARRAY_INITIALIZER_EXPRESSION
ID value representing an array initializer expression.

See Also:
Constant Field Values

UNARY_EXPRESSION

public static final int UNARY_EXPRESSION
ID value representing a unary expression.

See Also:
Constant Field Values

TYPECAST_EXPRESSION

public static final int TYPECAST_EXPRESSION
ID value representing a typecast.

See Also:
Constant Field Values

PRE_INC_OR_DEC_EXPRESSION

public static final int PRE_INC_OR_DEC_EXPRESSION
ID value representing a pre increment or decrement.

See Also:
Constant Field Values

POST_INC_OR_DEC_EXPRESSION

public static final int POST_INC_OR_DEC_EXPRESSION
ID value representing a post increment or decrement.

See Also:
Constant Field Values

INFIX_EXPRESSION

public static final int INFIX_EXPRESSION
ID value representing an infix expression.

See Also:
Constant Field Values

QUESTION_EXPRESSION

public static final int QUESTION_EXPRESSION
ID value representing a question expression.

See Also:
Constant Field Values

PRIMARY_EXPRESSION

public static final int PRIMARY_EXPRESSION
ID value representing a primary expression.

See Also:
Constant Field Values

ARRAY_DEREFERENCE_EXPRESSION

public static final int ARRAY_DEREFERENCE_EXPRESSION
ID value representing an array initializer expression.

See Also:
Constant Field Values
Method Detail

getExpressionType

public int getExpressionType()
Retrieves the kind of expression represented by this JotExpression.

Returns:
an integer ID indicating the expression type.

getExpressionString

public java.lang.String getExpressionString()
Retrieves the string representation of this expression.

Returns:
this expression as a String.

getAsMethodCall

public JotMethodCall getAsMethodCall()
Retrieves the JotMethodCall representing this expression if it is a method call.

Returns:
a JotMethodCall instance if this expression is a method call, or null otherwise.

getAsAssignment

public JotAssignment getAsAssignment()
Retrieves the JotAssignment representing this expression if it is an assignment.

Returns:
a JotAssignment instance if this expression is an assignment, or null otherwise.

getAsClassAllocation

public JotClassAllocation getAsClassAllocation()
Retrieves the JotClassAllocation representing this expression if it is a class allocation.

Returns:
a JotClassAllocation instance if this expression is a class allocation, or null otherwise.

getAsArrayAllocation

public JotArrayAllocation getAsArrayAllocation()
Retrieves the JotArrayAllocation representing this expression if it is an array allocation.

Returns:
a JotArrayAllocation instance if this expression is an array allocation, or null otherwise.

getAsAnonymousClass

public JotAnonymousClass getAsAnonymousClass()
Retrieves the JotAnonymousClass representing this expression if it is an anonymous class declaration.

Returns:
a JotAnonymousClass instance if this expression is an anonymous class declaration, or null otherwise.

getAsNestedExpression

public JotNestedExpression getAsNestedExpression()
Retrieves the JotNestedExpression representing this expression if it is a nested expression.

Returns:
a JotNestedExpression instance if this expression is a nested expression, or null otherwise.

getAsArrayInitializer

public JotArrayInitializer getAsArrayInitializer()
Retrieves the JotArrayInitializer representing this expression if it is an array initializer expression.

Returns:
a JotArrayInitializer instance if this expression is an array initializer expression, or null otherwise.

getAsArrayDereference

public JotArrayDereference getAsArrayDereference()
Retrieves the JotArrayDereference representing this expression if it is an array dereference expression.

Returns:
a JotArrayDereference instance if this expression is an array dereference expression, or null otherwise.

getAsUnaryExpression

public JotUnaryExpression getAsUnaryExpression()
Retrieves the JotUnaryExpression representing this expression if it is a unary expression.

Returns:
a JotUnaryExpression instance if this expression is a unary expression, or null otherwise.

getAsTypecast

public JotTypecast getAsTypecast()
Retrieves the JotTypecast representing this expression if it is a typecast.

Returns:
a JotTypecast instance if this expression is a typecast, or null otherwise.

getAsPreIncrementOrDecrement

public JotPreIncrementOrDecrement getAsPreIncrementOrDecrement()
Retrieves the JotPreIncrementOrDecrement representing this expression if it is a pre increment or decrement expression.

Returns:
a JotPreIncrementOrDecrement instance if this expression is a pre increment or decrement expression, or null otherwise.

getAsPostIncrementOrDecrement

public JotPostIncrementOrDecrement getAsPostIncrementOrDecrement()
Retrieves the JotPostIncrementOrDecrement representing this expression if it is a post increment or decrement expression.

Returns:
a JotPostIncrementOrDecrement instance if this expression is a nested expression, or null otherwise.

getAsInfixExpression

public JotInfixExpression getAsInfixExpression()
Retrieves the JotInfixExpression representing this expression if it is an infix expression.

Returns:
a JotInfixExpression instance if this expression is an infix expression, or null otherwise.

getAsQuestionExpression

public JotQuestionExpression getAsQuestionExpression()
Retrieves the JotQuestionExpression representing this expression if it is a question expression.

Returns:
a JotQuestionExpression instance if this expression is a question expression, or null otherwise.

getAsPrimaryExpression

public JotPrimaryExpression getAsPrimaryExpression()
Retrieves the JotPrimaryExpression representing this expression if it is a primary expression.

Returns:
a JotPrimaryExpression instance if this expression is a primary expression, or null otherwise.

isParenthesized

public boolean isParenthesized()
Whether this expression is enclosed within parenthesis.

Returns:
true if this expression is wrapped in a set of parenthesis.

setParenthesized

public void setParenthesized(boolean isParenthesized)
Sets the parenthesis state of this expression.

Parameters:
isParenthesized - true if this expression should be wrapped in a set of parenthesis.

renameObjectReference

public void renameObjectReference(java.lang.String oldName,
                                  java.lang.String newName)
Renames any occurrences of a given object name to another name.

Parameters:
oldName - the old name.
newName - the new name.

resolveTypeReference

public JotType resolveTypeReference(java.lang.String type)
Resolves a type name into a JotType, based on the current scope.

Parameters:
type - the type name (for example, String).
Returns:
the JotType representing the type.

getMinimumReferenceName

public java.lang.String getMinimumReferenceName(java.lang.String type)
Retrieves the minimum name required to reference the specified type, based on the current scope. For example, java.lang.String can usually be refered to as String.

Parameters:
type - the qualified typename
Returns:
the shortest reference name allowed by the current scope.

Extension SDK

 

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