01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.compiler;
11:
12: public class DefaultErrorHandlingPolicies {
13:
14: /*
15: * Accumulate all problems, then exit without proceeding.
16: *
17: * Typically, the #proceedWithProblems(Problem[]) should
18: * 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
35: * to be an error.
36: *
37: */
38: public static IErrorHandlingPolicy exitOnFirstError() {
39: return new IErrorHandlingPolicy() {
40: public boolean stopOnFirstError() {
41: return true;
42: }
43:
44: public boolean proceedOnErrors() {
45: return false;
46: }
47: };
48: }
49:
50: /*
51: * Proceed on the first error met.
52: *
53: */
54: public static IErrorHandlingPolicy proceedOnFirstError() {
55: return new IErrorHandlingPolicy() {
56: public boolean stopOnFirstError() {
57: return true;
58: }
59:
60: public boolean proceedOnErrors() {
61: return true;
62: }
63: };
64: }
65:
66: /*
67: * Accumulate all problems, then proceed with them.
68: *
69: */
70: public static IErrorHandlingPolicy proceedWithAllProblems() {
71: return new IErrorHandlingPolicy() {
72: public boolean stopOnFirstError() {
73: return false;
74: }
75:
76: public boolean proceedOnErrors() {
77: return true;
78: }
79: };
80: }
81: }
|