KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jzonic > jlo > error > MockErrorReporter


1 /*
2  * Created on 05.07.2004
3  * Created by crappy eclipse.
4  */

5 package org.jzonic.jlo.error;
6
7 import java.util.List JavaDoc;
8 import java.util.Vector JavaDoc;
9 /**
10  * @author Mecky
11  * shoot me because I am using eclipse
12  */

13 public class MockErrorReporter implements ErrorReporter {
14
15     private List JavaDoc messages;
16     
17     public MockErrorReporter() {
18         messages = new Vector JavaDoc();
19     }
20     /* (non-Javadoc)
21      * @see org.jzonic.jlo.error.ErrorReporter#reportError(java.lang.String)
22      */

23     public void reportError(String JavaDoc message) {
24         messages.add(message);
25     }
26
27     /* (non-Javadoc)
28      * @see org.jzonic.jlo.error.ErrorReporter#reportError(java.lang.String, java.lang.Throwable)
29      */

30     public void reportError(String JavaDoc message, Throwable JavaDoc thrown) {
31         messages.add(message);
32     }
33
34     /* (non-Javadoc)
35      * @see org.jzonic.jlo.error.ErrorReporter#reportError(java.lang.Throwable)
36      */

37     public void reportError(Throwable JavaDoc thrown) {
38         messages.add("exception:"+thrown.getMessage());
39     }
40     
41     public List JavaDoc getMessages() {
42         return messages;
43     }
44
45 }
46
Popular Tags