Class AnonymousClassDeclaration

java.lang.Object
org.eclipse.jdt.core.dom.ASTNode
org.eclipse.jdt.core.dom.AnonymousClassDeclaration

public class AnonymousClassDeclaration extends ASTNode
Anonymous class declaration AST node type. For JLS2, this type of node appears only as a child on a class instance creation expression. For JLS3, this type of node appears may also appear as the child of an enum constant declaration.
 AnonymousClassDeclaration:
        { ClassBodyDeclaration }
 
Since:
2.0
See Also:
Restriction:
This class is not intended to be instantiated by clients.
  • Field Details

    • BODY_DECLARATIONS_PROPERTY

      public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY
      The "bodyDeclarations" structural property of this node type (element type: BodyDeclaration).
      Since:
      3.0
  • Method Details

    • propertyDescriptors

      public static List propertyDescriptors(int apiLevel)
      Returns a list of structural property descriptors for this node type. Clients must not modify the result.
      Parameters:
      apiLevel - the API level; one of the AST.JLS* constants
      Returns:
      a list of property descriptors (element type: StructuralPropertyDescriptor)
      Since:
      3.0
    • bodyDeclarations

      public List bodyDeclarations()
      Returns the live ordered list of body declarations of this anonymous class declaration.
      Returns:
      the live list of body declarations (element type: BodyDeclaration)
    • resolveBinding

      public ITypeBinding resolveBinding()
      Resolves and returns the binding for the anonymous class declared in this declaration.

      Note that bindings are generally unavailable unless requested when the AST is being built.

      Returns:
      the binding, or null if the binding cannot be resolved