KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > compiler > DefaultErrorHandlingPolicies


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.compiler;
12
13 public class DefaultErrorHandlingPolicies {
14  
15 /*
16  * Accumulate all problems, then exit without proceeding.
17  *
18  * Typically, the #proceedWithProblems(Problem[]) should
19  * show the problems.
20  *
21  */

22 public static IErrorHandlingPolicy exitAfterAllProblems() {
23     return new IErrorHandlingPolicy() {
24         public boolean stopOnFirstError() {
25             return false;
26         }
27         public boolean proceedOnErrors(){
28             return false;
29         }
30     };
31 }
32 /*
33  * Exit without proceeding on the first problem wich appears
34  * to be an error.
35  *
36  */

37 public static IErrorHandlingPolicy exitOnFirstError() {
38     return new IErrorHandlingPolicy() {
39         public boolean stopOnFirstError() {
40             return true;
41         }
42         public boolean proceedOnErrors(){
43             return false;
44         }
45     };
46 }
47 /*
48  * Proceed on the first error met.
49  *
50  */

51 public static IErrorHandlingPolicy proceedOnFirstError() {
52     return new IErrorHandlingPolicy() {
53         public boolean stopOnFirstError() {
54             return true;
55         }
56         public boolean proceedOnErrors(){
57             return true;
58         }
59     };
60 }
61 /*
62  * Accumulate all problems, then proceed with them.
63  *
64  */

65 public static IErrorHandlingPolicy proceedWithAllProblems() {
66     return new IErrorHandlingPolicy() {
67         public boolean stopOnFirstError() {
68             return false;
69         }
70         public boolean proceedOnErrors(){
71             return true;
72         }
73     };
74 }
75 }
76
Popular Tags