public final class ObjectCreationExpr extends Expression implements NodeWithTypeArguments<ObjectCreationExpr>, NodeWithType<ObjectCreationExpr,ClassOrInterfaceType>, NodeWithArguments<ObjectCreationExpr>
new Object()
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration
Constructor and Description |
---|
ObjectCreationExpr() |
ObjectCreationExpr(Expression scope,
ClassOrInterfaceType type,
NodeList<Expression> args)
Defines a call to a constructor.
|
ObjectCreationExpr(Range range,
Expression scope,
ClassOrInterfaceType type,
NodeList<Type<?>> typeArguments,
NodeList<Expression> args,
NodeList<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) |
NodeList<BodyDeclaration<?>> |
getAnonymousClassBody()
This can be null, to indicate there is no body
|
NodeList<Expression> |
getArgs() |
Expression |
getScope() |
ClassOrInterfaceType |
getType()
Gets the type
|
NodeList<Type<?>> |
getTypeArguments() |
ObjectCreationExpr |
setAnonymousClassBody(NodeList<BodyDeclaration<?>> anonymousClassBody) |
ObjectCreationExpr |
setArgs(NodeList<Expression> args) |
ObjectCreationExpr |
setScope(Expression scope) |
ObjectCreationExpr |
setType(ClassOrInterfaceType type)
Sets the type
|
ObjectCreationExpr |
setTypeArguments(NodeList<Type<?>> typeArguments)
Allows you to set the generic arguments
|
addOrphanComment, clone, containsWithin, equals, getAllContainedComments, getBegin, getChildNodes, getComment, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getRange, getUserData, hasComment, hashCode, isPositionedAfter, isPositionedBefore, remove, setAsParentNodeOf, setBegin, setBlockComment, setComment, setEnd, setLineComment, setParentNode, setRange, setUserData, toString, toString, tryAddImportToParentCompilationUnit
finalize, getClass, notify, notifyAll, wait, wait, wait
isUsingDiamondOperator, removeTypeArguments, setDiamondOperator, setTypeArguments
setType, setType
addArgument, addArgument
getAncestorOfType, setAsParentNodeOf, setAsParentNodeOf
public ObjectCreationExpr()
public ObjectCreationExpr(Expression scope, ClassOrInterfaceType type, NodeList<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, NodeList<Type<?>> typeArguments, NodeList<Expression> args, NodeList<BodyDeclaration<?>> anonymousBody)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Visitable
accept
in interface Visitable
R
- the type of the return value of the visitorA
- the type the user argument passed to the visitorv
- the visitor implementationarg
- the argument passed to the visitor (of type A)public <A> void accept(VoidVisitor<A> v, A arg)
Visitable
public NodeList<BodyDeclaration<?>> getAnonymousClassBody()
public void addAnonymousClassBody(BodyDeclaration<?> body)
public NodeList<Expression> getArgs()
getArgs
in interface NodeWithArguments<ObjectCreationExpr>
public Expression getScope()
public ClassOrInterfaceType getType()
NodeWithType
getType
in interface NodeWithType<ObjectCreationExpr,ClassOrInterfaceType>
public ObjectCreationExpr setAnonymousClassBody(NodeList<BodyDeclaration<?>> anonymousClassBody)
public ObjectCreationExpr setArgs(NodeList<Expression> args)
setArgs
in interface NodeWithArguments<ObjectCreationExpr>
public ObjectCreationExpr setScope(Expression scope)
public ObjectCreationExpr setType(ClassOrInterfaceType type)
NodeWithType
setType
in interface NodeWithType<ObjectCreationExpr,ClassOrInterfaceType>
type
- the typepublic NodeList<Type<?>> getTypeArguments()
getTypeArguments
in interface NodeWithTypeArguments<ObjectCreationExpr>
public ObjectCreationExpr setTypeArguments(NodeList<Type<?>> typeArguments)
NodeWithTypeArguments
setTypeArguments
in interface NodeWithTypeArguments<ObjectCreationExpr>
typeArguments
- The list of types of the genericsCopyright © 2007–2016. All rights reserved.