public final class ObjectCreationExpr extends Expression implements NodeWithTypeArguments<ObjectCreationExpr>, NodeWithType<ObjectCreationExpr,ClassOrInterfaceType>, NodeWithArguments<ObjectCreationExpr>, NodeWithOptionalScope<ObjectCreationExpr>
new HashMap.Entry(15) {public String getKey() {return null;}};
HashMap is the scope, Entry is the type, String and Long are type arguments, 15 is an argument, and everything in { }
is the anonymous class body.Node.ObserverRegistrationMode
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration
Constructor and Description |
---|
ObjectCreationExpr() |
ObjectCreationExpr(Expression scope,
ClassOrInterfaceType type,
NodeList<Expression> arguments)
Defines a call to a constructor.
|
ObjectCreationExpr(Expression scope,
ClassOrInterfaceType type,
NodeList<Type> typeArguments,
NodeList<Expression> arguments,
NodeList<BodyDeclaration<?>> anonymousClassBody) |
ObjectCreationExpr(Range range,
Expression scope,
ClassOrInterfaceType type,
NodeList<Type> typeArguments,
NodeList<Expression> arguments,
NodeList<BodyDeclaration<?>> anonymousClassBody) |
addOrphanComment, containsWithin, equals, getAllContainedComments, getBegin, getChildNodes, getComment, getData, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getRange, hasComment, hashCode, isPositionedAfter, isPositionedBefore, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeOrphanComment, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setRange, toString, toString, tryAddImportToParentCompilationUnit, unregister
finalize, getClass, notify, notifyAll, wait, wait, wait
isUsingDiamondOperator, removeTypeArguments, setDiamondOperator, setTypeArguments
setType, setType, tryAddImportToParentCompilationUnit
addArgument, addArgument, getArgument, setArgument
getAncestorOfType, setAsParentNodeOf, setAsParentNodeOf
public ObjectCreationExpr()
public ObjectCreationExpr(Expression scope, ClassOrInterfaceType type, NodeList<Expression> arguments)
scope
- may be nulltype
- this is the class that the constructor is being called for.arguments
- Any arguments to pass to the constructorpublic ObjectCreationExpr(Expression scope, ClassOrInterfaceType type, NodeList<Type> typeArguments, NodeList<Expression> arguments, NodeList<BodyDeclaration<?>> anonymousClassBody)
public ObjectCreationExpr(Range range, Expression scope, ClassOrInterfaceType type, NodeList<Type> typeArguments, NodeList<Expression> arguments, NodeList<BodyDeclaration<?>> anonymousClassBody)
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 Optional<NodeList<BodyDeclaration<?>>> getAnonymousClassBody()
public void addAnonymousClassBody(BodyDeclaration<?> body)
public NodeList<Expression> getArguments()
getArguments
in interface NodeWithArguments<ObjectCreationExpr>
public Optional<Expression> getScope()
getScope
in interface NodeWithOptionalScope<ObjectCreationExpr>
public ClassOrInterfaceType getType()
NodeWithType
getType
in interface NodeWithType<ObjectCreationExpr,ClassOrInterfaceType>
public ObjectCreationExpr setAnonymousClassBody(NodeList<BodyDeclaration<?>> anonymousClassBody)
anonymousClassBody
- the anonymousClassBody, can be null or emptypublic ObjectCreationExpr setArguments(NodeList<Expression> arguments)
setArguments
in interface NodeWithArguments<ObjectCreationExpr>
public ObjectCreationExpr setScope(Expression scope)
setScope
in interface NodeWithOptionalScope<ObjectCreationExpr>
scope
- the scope, can be nullpublic ObjectCreationExpr setType(ClassOrInterfaceType type)
NodeWithType
setType
in interface NodeWithType<ObjectCreationExpr,ClassOrInterfaceType>
type
- the typepublic Optional<NodeList<Type>> getTypeArguments()
getTypeArguments
in interface NodeWithTypeArguments<ObjectCreationExpr>
public ObjectCreationExpr setTypeArguments(NodeList<Type> typeArguments)
setTypeArguments
in interface NodeWithTypeArguments<ObjectCreationExpr>
typeArguments
- the typeArguments, can be nullpublic List<NodeList<?>> getNodeLists()
Node
getNodeLists
in class Node
public boolean remove(Node node)
remove
in class Expression
public ObjectCreationExpr removeScope()
NodeWithOptionalScope
NodeWithOptionalScope.setScope(com.github.javaparser.ast.expr.Expression)
with null.removeScope
in interface NodeWithOptionalScope<ObjectCreationExpr>
public ObjectCreationExpr clone()
clone
in class Expression
public ObjectCreationExprMetaModel getMetaModel()
getMetaModel
in class Expression
Copyright © 2007–2017. All rights reserved.