new HashMap.Entry<String, Long>(15) {public String getKey() {return null;}};
HashMap.Entry is the type, String and Long are type arguments, 15 is an argument, and everything in { }
is the anonymous class body.
In class B { class C { public void a() { new B().new C(); } } } the scope is new B()
of ObjectCreationExpr new B().new C()
| Modifier and Type | Field and Description |
|---|---|
| private NodeList | |
| private NodeList | |
| private Expression | |
| private ClassOrInterfaceType | |
| private NodeList |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ObjectCreationExpr(final Expression
may be null scope, final ClassOrInterfaceType this is the class that the constructor is being called for. type, final NodeList<Expression> Any arguments to pass to the constructor arguments)Defines a call to a constructor. |
| public | ObjectCreationExpr(final Expression scope, final ClassOrInterfaceType type, final NodeList<Type> typeArguments, final NodeList<Expression> arguments, final NodeList<BodyDeclaration<?>> anonymousClassBody)
|
| public | ObjectCreationExpr(TokenRange tokenRange, Expression scope, ClassOrInterfaceType type, NodeList<Type> typeArguments, NodeList<Expression> arguments, NodeList<BodyDeclaration<?>> anonymousClassBody)
This constructor is used by the parser and is considered private. |
| Modifier and Type | Method and Description |
|---|---|
| public <R, A> R | accept(final GenericVisitor<R, A>
the visitor implementation v, final A the argument passed to the visitor (of type A) arg)Implements com. |
| public <A> void | accept(final VoidVisitor<A>
the visitor implementation v, final A any value relevant for the visitor (of type A) arg)Implements com. |
| public void | |
| public ObjectCreationExpr | |
| public ObjectCreationExpr | clone()
Creates and returns a copy of this object.
|
| public Optional | |
| public NodeList | |
| public ObjectCreationExprMetaModel | |
| public Optional | |
| public ClassOrInterfaceType | |
| public Optional | |
| public void | |
| public boolean | |
| public boolean | |
| public ObjectCreationExpr | |
| public boolean | replace(Node node, Node replacementNode)
Overrides com. |
| public ResolvedConstructorDeclaration | Returns: aResolvedConstructorDeclaration representing the declaration of the invoked constructor.Implements com. |
| public ObjectCreationExpr | Returns: this, the ObjectCreationExprthe anonymousClassBody, can be null or empty anonymousClassBody)Sets the anonymousClassBody Null means no class body Empty NodeList means new ClassName(){ } |
| public ObjectCreationExpr | setArguments(final NodeList<Expression> arguments)
Implements com. |
| public ObjectCreationExpr | Returns: this, the ObjectCreationExprthe scope, can be null scope)Implements com. |
| public ObjectCreationExpr | setType(final ClassOrInterfaceType
the type type)Implements com. |
| public ObjectCreationExpr | Returns: this, the ObjectCreationExprthe typeArguments, can be null typeArguments)Implements com. |
| public Optional |
| anonymousClassBody | back to summary |
|---|---|
| private NodeList<BodyDeclaration<?>> anonymousClassBody
| |
| arguments | back to summary |
|---|---|
| private NodeList<Expression> arguments | |
| scope | back to summary |
|---|---|
| private Expression scope
| |
| type | back to summary |
|---|---|
| private ClassOrInterfaceType type | |
| typeArguments | back to summary |
|---|---|
| private NodeList<Type> typeArguments
| |
| ObjectCreationExpr | back to summary |
|---|---|
| public ObjectCreationExpr() | |
| ObjectCreationExpr | back to summary |
|---|---|
| public ObjectCreationExpr(final Expression scope, final ClassOrInterfaceType type, final NodeList<Expression> arguments) Defines a call to a constructor.
| |
| ObjectCreationExpr | back to summary |
|---|---|
public ObjectCreationExpr(final Expression scope, final ClassOrInterfaceType type, final NodeList<Type> typeArguments, final NodeList<Expression> arguments, final NodeList<BodyDeclaration<?>> anonymousClassBody)
| |
| ObjectCreationExpr | back to summary |
|---|---|
| public ObjectCreationExpr(TokenRange tokenRange, Expression scope, ClassOrInterfaceType type, NodeList<Type> typeArguments, NodeList<Expression> arguments, NodeList<BodyDeclaration<?>> anonymousClassBody) This constructor is used by the parser and is considered private.
| |
| accept | back to summary |
|---|---|
| public <R, A> R accept(final GenericVisitor<R, A> v, final A arg) Implements com. Doc from com. Accept method for visitor support.
| |
| accept | back to summary |
|---|---|
| public <A> void accept(final VoidVisitor<A> v, final A arg) Implements com. Doc from com. Accept method for visitor support.
| |
| addAnonymousClassBody | back to summary |
|---|---|
| public void addAnonymousClassBody(BodyDeclaration<?> body) | |
| asObjectCreationExpr | back to summary |
|---|---|
| public ObjectCreationExpr asObjectCreationExpr() Overrides com.
| |
| clone | back to summary |
|---|---|
| public ObjectCreationExpr clone() Overrides com. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| getAnonymousClassBody | back to summary |
|---|---|
public Optional
| |
| getArguments | back to summary |
|---|---|
| public NodeList Implements com.
| |
| getMetaModel | back to summary |
|---|---|
| public ObjectCreationExprMetaModel getMetaModel() Overrides com.
| |
| getScope | back to summary |
|---|---|
| public Optional Implements com.
| |
| getType | back to summary |
|---|---|
| public ClassOrInterfaceType getType() Implements com. Doc from com. Gets the type
| |
| getTypeArguments | back to summary |
|---|---|
| public Optional Implements com.
| |
| ifObjectCreationExpr | back to summary |
|---|---|
| public void ifObjectCreationExpr(Consumer<ObjectCreationExpr> action) Overrides com.
| |
| isObjectCreationExpr | back to summary |
|---|---|
| public boolean isObjectCreationExpr() Overrides com.
| |
| remove | back to summary |
|---|---|
| public boolean remove(Node node) Overrides com.
| |
| removeScope | back to summary |
|---|---|
| public ObjectCreationExpr removeScope() Implements com.
| |
| replace | back to summary |
|---|---|
| public boolean replace(Node node, Node replacementNode) Overrides com.
| |
| resolve | back to summary |
|---|---|
| public ResolvedConstructorDeclaration resolve() Implements com. Attempts to resolve the declaration corresponding to the invoked constructor. If successful, a
| |
| setAnonymousClassBody | back to summary |
|---|---|
| public ObjectCreationExpr setAnonymousClassBody(final NodeList<BodyDeclaration<?>> anonymousClassBody) Sets the anonymousClassBody
| |
| setArguments | back to summary |
|---|---|
| public ObjectCreationExpr setArguments(final NodeList<Expression> arguments) Implements com.
| |
| setScope | back to summary |
|---|---|
| public ObjectCreationExpr setScope(final Expression scope) Implements com. Sets the scope
| |
| setType | back to summary |
|---|---|
| public ObjectCreationExpr setType(final ClassOrInterfaceType type) Implements com. Doc from com. Sets the type
| |
| setTypeArguments | back to summary |
|---|---|
| public ObjectCreationExpr setTypeArguments(final NodeList<Type> typeArguments) Implements com. Sets the typeArguments
| |
| toObjectCreationExpr | back to summary |
|---|---|
| public Optional Overrides com.
| |