oracle.jdeveloper.jot
Interface JotClassAllocation
- All Superinterfaces:
- JotAllocation, JotCodeElement, 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"
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 |
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.JotCodeElement |
addPrecedingComment, childrenContainErrors, delete, getContainingJotFile, getLeftWhitespace, getLength, getRightWhitespace, isInError, isSource, setLeftWhitespace, setRightWhitespace |
Methods inherited from interface oracle.jdeveloper.jot.JotElement |
getChildren, getContainedElements, getElementName, getElementType, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent |
getArguments
public JotExpression[] getArguments()
throws JotInvalidElementException
- 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.
- Throws:
JotInvalidElementException
setArgument
public JotExpression setArgument(int idx,
java.lang.String exp)
throws JotInvalidElementException
- 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
.
- Throws:
JotInvalidElementException
addArgument
public JotExpression addArgument(JotExpression marker,
boolean before,
java.lang.String exp)
throws JotInvalidElementException
- 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.
- Throws:
JotInvalidElementException
removeArgument
public void removeArgument(JotExpression oldExp)
throws JotInvalidElementException
- Removes an existing argument.
-
- Throws:
JotInvalidElementException
Copyright © 1997, 2004, Oracle. All rights reserved.