01: package com.opensymphony.webwork.util.classloader.problems;
02:
03: import java.util.ArrayList;
04: import java.util.Collection;
05:
06: public class DefaultCompilationProblemHandler implements
07: CompilationProblemHandler {
08:
09: final Collection errors = new ArrayList();
10: final Collection warnings = new ArrayList();
11:
12: public void onStart() {
13: errors.clear();
14: warnings.clear();
15: }
16:
17: public void handle(final CompilationProblem pProblem) {
18: if (pProblem.isError()) {
19: errors.add(pProblem);
20: } else {
21: warnings.add(pProblem);
22: }
23: }
24:
25: public void onStop() {
26: }
27:
28: public CompilationProblem[] getErrors() {
29: final CompilationProblem[] result = new CompilationProblem[errors
30: .size()];
31: errors.toArray(result);
32: return result;
33: }
34:
35: public CompilationProblem[] getWarnings() {
36: final CompilationProblem[] result = new CompilationProblem[warnings
37: .size()];
38: warnings.toArray(result);
39: return result;
40: }
41: }
|