APIdia Launch Partner
Top Description Methods
com.sun.source.tree

public Interface NewClassTree

extends ExpressionTree
Known Direct Implementers
com.sun.tools.javac.tree.JCTree.JCNewClass
Imports
java.util.List

A tree node to declare a new instance of a class. For example:
  new identifier ( )

  new identifier ( arguments )

  new typeArguments identifier ( arguments )
      classBody

  enclosingExpression.new identifier ( arguments )
Authors
Peter von der Ahé, Jonathan Gibbons
Since
1.6
Java Language Specification
15.9 Class Instance Creation Expressions

Method Summary

Modifier and TypeMethod and Description
public List<? extends ExpressionTree>

Returns:

the arguments
getArguments
()

Returns the arguments for the constructor to be invoked.

public ClassTree

Returns:

the class body
getClassBody
()

Returns the class body if an anonymous class is being instantiated, and null otherwise.

public ExpressionTree

Returns:

the enclosing expression
getEnclosingExpression
()

Returns the enclosing expression, or null if none.

public ExpressionTree

Returns:

the name
getIdentifier
()

Returns the name of the class being instantiated.

public List<? extends Tree>

Returns:

the type arguments
getTypeArguments
()

Returns the type arguments for the object being created.

Method Detail

getArgumentsback to summary
public List<? extends ExpressionTree> getArguments()

Returns the arguments for the constructor to be invoked.

Returns:List<? extends ExpressionTree>

the arguments

getClassBodyback to summary
public ClassTree getClassBody()

Returns the class body if an anonymous class is being instantiated, and null otherwise.

Returns:ClassTree

the class body

getEnclosingExpressionback to summary
public ExpressionTree getEnclosingExpression()

Returns the enclosing expression, or null if none.

Returns:ExpressionTree

the enclosing expression

getIdentifierback to summary
public ExpressionTree getIdentifier()

Returns the name of the class being instantiated.

Returns:ExpressionTree

the name

getTypeArgumentsback to summary
public List<? extends Tree> getTypeArguments()

Returns the type arguments for the object being created.

Returns:List<? extends Tree>

the type arguments