View Javadoc

1   /*
2    * ASTryStatement.java
3    * 
4    * Copyright (c) 2008 David Holroyd
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package uk.co.badgersinfoil.metaas.dom;
20  
21  import java.util.List;
22  
23  /**
24   * A try-statement, such as <code>try {  } catch (e) {  }</code>.
25   * 
26   * <p>A statement container may have multiple catch-clauses and may have a
27   * single finally-clause.  At either a catch-cluase or a finally-clause must
28   * be present.</p>
29   * 
30   * <p>The body of the try-statement (the braces right after the
31   * <code>try</code> keyword) can be accessed by calling the methods of
32   * {@link StatementContainer} on the ASTryStatement instance.</p>
33   * 
34   * @see StatementContainer#newTryCatch(String, String)
35   * @see StatementContainer#newTryFinally()
36   */
37  public interface ASTryStatement extends StatementContainer, Statement {
38  
39  	public ASCatchClause newCatchClause(String var, String type);
40  
41  	/**
42  	 * Returns a list of {@link ASCatchClause}.
43  	 */
44  	public List getCatchClauses();
45  
46  	public ASFinallyClause getFinallyClause();
47  
48  	public ASFinallyClause newFinallyClause();
49  
50  }