public final class ObjectCreationExpr extends Expression implements NodeWithTypeArguments<ObjectCreationExpr>, NodeWithType<ObjectCreationExpr>
new Object()
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION
Constructor and Description |
---|
ObjectCreationExpr() |
ObjectCreationExpr(Expression scope,
ClassOrInterfaceType type,
List<Expression> args)
Defines a call to a constructor.
|
ObjectCreationExpr(Range range,
Expression scope,
ClassOrInterfaceType type,
List<Type<?>> typeArguments,
List<Expression> args,
List<BodyDeclaration<?>> anonymousBody) |
Modifier and Type | Method and Description |
---|---|
<R,A> R |
accept(GenericVisitor<R,A> v,
A arg)
Accept method for visitor support.
|
<A> void |
accept(VoidVisitor<A> v,
A arg)
Accept method for visitor support.
|
void |
addAnonymousClassBody(BodyDeclaration<?> body) |
List<BodyDeclaration<?>> |
getAnonymousClassBody()
This can be null, to indicate there is no body
|
List<Expression> |
getArgs() |
Expression |
getScope() |
ClassOrInterfaceType |
getType()
Gets the type
|
List<Type<?>> |
getTypeArguments() |
ObjectCreationExpr |
setAnonymousClassBody(List<BodyDeclaration<?>> anonymousClassBody) |
ObjectCreationExpr |
setArgs(List<Expression> args) |
ObjectCreationExpr |
setScope(Expression scope) |
ObjectCreationExpr |
setType(Type<?> type)
Sets the type
|
ObjectCreationExpr |
setTypeArguments(List<Type<?>> types)
Allows you to set the generic arguments
|
addOrphanComment, clone, contains, equals, getAllContainedComments, getBegin, getChildrenNodes, getComment, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeOfType, getRange, getUserData, hasComment, hashCode, isPositionedAfter, isPositionedBefore, remove, setAsParentNodeOf, setAsParentNodeOf, setBegin, setBlockComment, setComment, setEnd, setLineComment, setParentNode, setRange, setUserData, toString, toStringWithoutComments, tryAddImportToParentCompilationUnit
finalize, getClass, notify, notifyAll, wait, wait, wait
isUsingDiamondOperator, removeTypeArguments, setDiamondOperator, setTypeArguments
setType, setType
public ObjectCreationExpr()
public ObjectCreationExpr(Expression scope, ClassOrInterfaceType type, List<Expression> args)
scope
- may be nulltype
- this is the class that the constructor is being called for.args
- Any arguments to pass to the constructorpublic ObjectCreationExpr(Range range, Expression scope, ClassOrInterfaceType type, List<Type<?>> typeArguments, List<Expression> args, List<BodyDeclaration<?>> anonymousBody)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Node
public <A> void accept(VoidVisitor<A> v, A arg)
Node
public List<BodyDeclaration<?>> getAnonymousClassBody()
public void addAnonymousClassBody(BodyDeclaration<?> body)
public List<Expression> getArgs()
public Expression getScope()
public ClassOrInterfaceType getType()
NodeWithType
getType
in interface NodeWithType<ObjectCreationExpr>
public ObjectCreationExpr setAnonymousClassBody(List<BodyDeclaration<?>> anonymousClassBody)
public ObjectCreationExpr setArgs(List<Expression> args)
public ObjectCreationExpr setScope(Expression scope)
public ObjectCreationExpr setType(Type<?> type)
NodeWithType
setType
in interface NodeWithType<ObjectCreationExpr>
type
- the typepublic List<Type<?>> getTypeArguments()
getTypeArguments
in interface NodeWithTypeArguments<ObjectCreationExpr>
public ObjectCreationExpr setTypeArguments(List<Type<?>> types)
NodeWithTypeArguments
setTypeArguments
in interface NodeWithTypeArguments<ObjectCreationExpr>
types
- The list of types of the genericsCopyright © 2007–2016. All rights reserved.