Extension SDK

oracle.jdeveloper.jot
Interface JotClassAllocation

All Superinterfaces:
JotAllocation, JotElement, JotExpression, JotStatementExpression
All Known Subinterfaces:
JotAnonymousClass

public interface JotClassAllocation
extends JotAllocation, JotStatementExpression

The JotClassAllocation interface represents a class allocation expression. Class allocation expressions create new object instances. Class allocation expressions extend basic allocation expressions by optionally providing arguments in the form of expressions that are passed to the appropriate object constructor. Class allocation expressions have the form:

   new Panel();
   new Integer(10);
   new String(myBytes, 0, myBytes.length, getConverter())
 

Since:
5.0
See Also:
"Section 15.9 of the Java Language Specification Second Edition"

Field Summary
 
Fields inherited from interface oracle.jdeveloper.jot.JotExpression
ANONYMOUS_CLASS_ALLOCATION_EXPRESSION, ARRAY_ALLOCATION_EXPRESSION, ARRAY_DEREFERENCE_EXPRESSION, ARRAY_INITIALIZER_EXPRESSION, ASSIGNMENT_EXPRESSION, CLASS_ALLOCATION_EXPRESSION, INFIX_EXPRESSION, METHOD_CALL_EXPRESSION, NESTED_EXPRESSION, POST_INC_OR_DEC_EXPRESSION, PRE_INC_OR_DEC_EXPRESSION, PRIMARY_EXPRESSION, QUESTION_EXPRESSION, TYPECAST_EXPRESSION, UNARY_EXPRESSION, UNCATEGORIZED_EXPRESSION
 
Method Summary
 JotExpression addArgument(JotExpression marker, boolean before, java.lang.String exp)
          Adds a new argument.
 JotExpression[] getArguments()
          Retrieves the arguments being passed to the class constructor.
 void removeArgument(JotExpression oldExp)
          Removes an existing argument.
 JotExpression setArgument(int idx, java.lang.String exp)
          Sets an argument in the call to the constructor.
 
Methods inherited from interface oracle.jdeveloper.jot.JotAllocation
getObjectType, setObjectType
 
Methods inherited from interface oracle.jdeveloper.jot.JotExpression
getAsAnonymousClass, getAsArrayAllocation, getAsArrayDereference, getAsArrayInitializer, getAsAssignment, getAsClassAllocation, getAsInfixExpression, getAsMethodCall, getAsNestedExpression, getAsPostIncrementOrDecrement, getAsPreIncrementOrDecrement, getAsPrimaryExpression, getAsQuestionExpression, getAsTypecast, getAsUnaryExpression, getExpressionString, getExpressionType, getMinimumReferenceName, isParenthesized, renameObjectReference, resolveTypeReference, setParenthesized
 
Methods inherited from interface oracle.jdeveloper.jot.JotElement
getElementName, getElementType, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent
 

Method Detail

getArguments

public JotExpression[] getArguments()
Retrieves the arguments being passed to the class constructor.

Returns:
an array of expressions. If the class constructor takes no arguments, the array will have a length of zero.

setArgument

public JotExpression setArgument(int idx,
                                 java.lang.String exp)
Sets an argument in the call to the constructor. The existing argument expression is removed.

Parameters:
idx - the index of the argument to add.
exp - the argument expression string.
Returns:
the newly added argument as a JotExpression.

addArgument

public JotExpression addArgument(JotExpression marker,
                                 boolean before,
                                 java.lang.String exp)
Adds a new argument.

Parameters:
marker - the argument to position relative to.
before - whether to position the new argument before or after the marker argument; or, if the marker is null, whether to position the new argument at the beginning or the end of the argument list.
exp - the new argument string
Returns:
the new argument as a JotExpression.

removeArgument

public void removeArgument(JotExpression oldExp)
Removes an existing argument.


Extension SDK

 

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