com.borland.jbuilder.jot
Interface JotExpression

All Superinterfaces:
JotMarker, JotSourceElement
All Known Subinterfaces:
JotAssignment, JotBinaryExpression, JotCondition, JotInitializer, JotMethodCall, JotNew, JotSubscript, JotTypeop, JotUnaryExpression

public interface JotExpression
extends JotMarker, JotSourceElement

This interface provides methods for tools to extract values from assignments, arguments, initializers, and other types of expressions.

An expression might be any of the following (list is not exhaustive):


Method Summary
 JotAssignment getAssignment()
          Returns the JotAssignment instance representing this expression.
 JotCondition getCondition()
          Returns the JotCondition instance representing this expression.
 JotMethodCall getMethodCall()
          Returns the JotMethodCall instance representing this expression.
 JotNew getNew()
          Returns the JotNew instance representing this expression.
 JotExpression getOperation()
          Returns the JotOperation instance representing this expression.
 JotValue getValue()
          Returns a JotValue instance which contains the value of this expression.
 JotVariable getVariable()
          Returns the JotVariable instance representing this expression.
 boolean isConstant()
          Returns true if this expression is constant.
 boolean isNull()
          Returns true if the text of this expression is null.
 
Methods inherited from interface com.borland.jbuilder.jot.JotMarker
addUserData, getEndPosition, getStartPosition, getUserData
 
Methods inherited from interface com.borland.jbuilder.jot.JotSourceElement
getIndentLevel, getParent, getText, isModified, setModified, setText
 

Method Detail

getValue

public JotValue getValue()
                  throws java.lang.IllegalArgumentException
Returns a JotValue instance which contains the value of this expression.

isConstant

public boolean isConstant()
Returns true if this expression is constant.

isNull

public boolean isNull()
Returns true if the text of this expression is null. Note that this method will not evaluate the expression, so it will return false even for expressions that evaluate to null.

getVariable

public JotVariable getVariable()
Returns the JotVariable instance representing this expression. If this expression is not a variable reference, then returns null.

getAssignment

public JotAssignment getAssignment()
Returns the JotAssignment instance representing this expression. If this expression is not an assignment, then returns null.

getMethodCall

public JotMethodCall getMethodCall()
Returns the JotMethodCall instance representing this expression. If this expression is not a method invocation, then returns null.

getNew

public JotNew getNew()
Returns the JotNew instance representing this expression. If this expression is not an object instantiation, then returns null.

getCondition

public JotCondition getCondition()
Returns the JotCondition instance representing this expression. If this expression is not a condition expression, then returns null.

getOperation

public JotExpression getOperation()
Returns the JotOperation instance representing this expression. If this expression is not an operation, then returns null.