Class CatchClause

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

public class CatchClause extends ASTNode
Catch clause AST node type.
 CatchClause:
    catch ( FormalParameter ) Block
 

The FormalParameter is represented by a SingleVariableDeclaration.

Since:
2.0
Restriction:
This class is not intended to be instantiated by clients.
  • Field Details

  • 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
    • getException

      public SingleVariableDeclaration getException()
      Returns the exception variable declaration of this catch clause.
      Returns:
      the exception variable declaration node
    • setException

      public void setException(SingleVariableDeclaration exception)
      Sets the variable declaration of this catch clause.
      Parameters:
      exception - the exception variable declaration node
      Throws:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created
    • getBody

      public Block getBody()
      Returns the body of this catch clause.
      Returns:
      the catch clause body
    • setBody

      public void setBody(Block body)
      Sets the body of this catch clause.
      Parameters:
      body - the catch clause block node
      Throws:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created