Documentation update from php.net
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / DefaultErrorHandlingPolicies.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler;
12
13 public class DefaultErrorHandlingPolicies {
14
15         /*
16          * Accumulate all problems, then exit without proceeding.
17          * 
18          * Typically, the #proceedWithProblems(Problem[]) should show the problems.
19          * 
20          */
21         public static IErrorHandlingPolicy exitAfterAllProblems() {
22                 return new IErrorHandlingPolicy() {
23                         public boolean stopOnFirstError() {
24                                 return false;
25                         }
26
27                         public boolean proceedOnErrors() {
28                                 return false;
29                         }
30                 };
31         }
32
33         /*
34          * Exit without proceeding on the first problem wich appears to be an error.
35          * 
36          */
37         public static IErrorHandlingPolicy exitOnFirstError() {
38                 return new IErrorHandlingPolicy() {
39                         public boolean stopOnFirstError() {
40                                 return true;
41                         }
42
43                         public boolean proceedOnErrors() {
44                                 return false;
45                         }
46                 };
47         }
48
49         /*
50          * Proceed on the first error met.
51          * 
52          */
53         public static IErrorHandlingPolicy proceedOnFirstError() {
54                 return new IErrorHandlingPolicy() {
55                         public boolean stopOnFirstError() {
56                                 return true;
57                         }
58
59                         public boolean proceedOnErrors() {
60                                 return true;
61                         }
62                 };
63         }
64
65         /*
66          * Accumulate all problems, then proceed with them.
67          * 
68          */
69         public static IErrorHandlingPolicy proceedWithAllProblems() {
70                 return new IErrorHandlingPolicy() {
71                         public boolean stopOnFirstError() {
72                                 return false;
73                         }
74
75                         public boolean proceedOnErrors() {
76                                 return true;
77                         }
78                 };
79         }
80 }