public class NewExpression extends Expression implements INewExpression
new-expression
new <type-expression> ( [<argument-list>] ) [ {...} ]
new <type-expression> [ <expression> ]
new <type-expression> [] { [<array-value-list>] }
IGosuParser_type_tokens, UNDEF_FILE, UNDEF_FUNCTION, UNDEF_MODULEEMPTY_ARRAY| Constructor and Description |
|---|
NewExpression()
Constructs a BeanMethodCallExpression given an ISymbolTable instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSizeExpression(Expression sizeExpression)
The size expression for the new array operation.
|
Object |
evaluate() |
int |
getArgPosition() |
Expression[] |
getArgs() |
IType[] |
getArgTypes() |
IConstructorInfo |
getConstructor() |
IInitializerExpression |
getInitializer() |
int[] |
getNamedArgOrder() |
List<Expression> |
getSizeExpressions() |
ITypeLiteralExpression |
getTypeLiteral() |
List<Expression> |
getValueExpressions() |
boolean |
isAnonymousClass() |
boolean |
isCompileTimeConstant() |
void |
setAnonymousClass(boolean anonymous) |
void |
setArgPosition(int iArgPos) |
void |
setArgs(Expression[] args) |
void |
setArgTypes(IType... argTypes) |
void |
setConstructor(IConstructorInfo constructor)
The constructor for the new operation.
|
void |
setInitializer(IInitializerExpression initializerExpression) |
void |
setNamedArgOrder(int[] namedArgOrder) |
void |
setTypeLiteral(ITypeLiteralExpression typeLiteral) |
void |
setValueExpressions(List<Expression> valueExpressions)
The value expression for the new array operation.
|
String |
toString()
Subclasses should return a String representing the parsed expression.
|
evaluate, getContextType, getReturnType, getType, getTypeImpl, isNullSafe, isUnchecked, setTypeaddExceptionsFrom, addParseException, addParseException, addParseException, addParseExceptions, addParseIssues, addParseWarning, addParseWarning, addParseWarnings, addToken, adjustColumn, adjustLineNum, assignTokens, clearParseExceptions, clearParseTreeInformation, clearParseWarnings, compactParseTree, findAncestorParsedElementByType, findDeclaringStatement, findLineNumberOfDeclaration, findRootParsedElement, getAnnotations, getColumn, getContainedParsedElementsByType, getContainedParsedElementsByTypes, getContainedParsedElementsByTypesWithIgnoreSet, getEnclosingFeatureInfo, getFunctionName, getGosuClass, getGosuProgram, getImmediateParseIssue, getImmediateParseIssues, getLineNum, getLocation, getModule, getParent, getParseExceptions, getParseIssues, getParseWarnings, getQualifyingEnclosingTypeInfo, getTokens, hasImmediateParseIssue, hasImmediateParseWarning, hasImmediateParseWarnings, hasParseException, hasParseExceptions, hasParseIssue, hasParseIssues, hasParseWarning, hasParseWarnings, initEmptyParseTree, initLocation, isSuppressed, isSuppressed, isSynthetic, makeDoubleValue, makeFloatValue, makeInteger, makeLong, removeParseException, removeParseWarning, removeParseWarningRecursively, setGosuProgram, setLineNum, setLocation, setParent, setSynthetic, shouldClearParseInfoclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitevaluate, getContextType, isNullSafe, isUncheckedaddExceptionsFrom, addParseException, addParseException, addParseWarning, addParseWarning, clearParseExceptions, clearParseTreeInformation, clearParseWarnings, findAncestorParsedElementByType, findDeclaringStatement, findRootParsedElement, getColumn, getContainedParsedElementsByType, getContainedParsedElementsByTypes, getContainedParsedElementsByTypesWithIgnoreSet, getFunctionName, getGosuClass, getGosuProgram, getImmediateParseIssue, getImmediateParseIssues, getLineNum, getLocation, getModule, getParent, getParseExceptions, getParseIssues, getParseWarnings, getReturnType, getTokens, hasImmediateParseIssue, hasImmediateParseWarnings, hasParseException, hasParseExceptions, hasParseIssue, hasParseIssues, hasParseWarning, hasParseWarnings, isSuppressed, isSynthetic, setLocation, setParentpublic NewExpression()
public IType[] getArgTypes()
getArgTypes in interface INewExpressionpublic void setArgTypes(IType... argTypes)
argTypes - An array of IType for the arguments of the method call.public Expression[] getArgs()
getArgs in interface INewExpressiongetArgs in interface IHasArgumentspublic void setArgs(Expression[] args)
args - An array of expressions for corresponding to the arguments in
the expression.public IConstructorInfo getConstructor()
getConstructor in interface INewExpressionpublic int getArgPosition()
getArgPosition in interface IHasArgumentspublic void setArgPosition(int iArgPos)
public void setConstructor(IConstructorInfo constructor)
public void setValueExpressions(List<Expression> valueExpressions)
public List<Expression> getValueExpressions()
getValueExpressions in interface INewExpressionpublic void setInitializer(IInitializerExpression initializerExpression)
public IInitializerExpression getInitializer()
getInitializer in interface INewExpressionpublic void addSizeExpression(Expression sizeExpression)
public List<Expression> getSizeExpressions()
getSizeExpressions in interface INewExpressionpublic boolean isCompileTimeConstant()
isCompileTimeConstant in interface IParsedElementisCompileTimeConstant in class ParsedElementpublic Object evaluate()
evaluate in interface IExpressionevaluate in class Expressionpublic String toString()
ExpressiontoString in class Expressionpublic boolean isAnonymousClass()
isAnonymousClass in interface INewExpressionpublic void setAnonymousClass(boolean anonymous)
public ITypeLiteralExpression getTypeLiteral()
getTypeLiteral in interface INewExpressionpublic void setTypeLiteral(ITypeLiteralExpression typeLiteral)
public int[] getNamedArgOrder()
public void setNamedArgOrder(int[] namedArgOrder)
Copyright © 2022. All rights reserved.