Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
6   73   6   1
0   28   1   6
6     1  
1    
 
  DefaultModuleEventListener       Line # 28 6 6 100% 1.0
 
  (4)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15   
16    package org.qedeq.kernel.bo.log;
17   
18    import java.io.PrintStream;
19   
20    import org.qedeq.base.utility.DateUtility;
21    import org.qedeq.kernel.bo.common.QedeqBo;
22   
23    /**
24    * Listener that writes events to a stream.
25    *
26    * @author Michael Meyling
27    */
 
28    public class DefaultModuleEventListener implements ModuleEventListener {
29   
30    /** Stream for output. */
31    private PrintStream out = System.out;
32   
33    /**
34    * Constructor.
35    */
 
36  1 toggle public DefaultModuleEventListener() {
37  1 this(System.out);
38    }
39   
40    /**
41    * Constructor.
42    *
43    * @param stream Print to this stream.
44    */
 
45  5 toggle public DefaultModuleEventListener(final PrintStream stream) {
46  5 this.out = stream;
47    }
48   
49    /**
50    * Set output stream.
51    *
52    * @param stream Output stream.
53    */
 
54  1 toggle public final void setPrintStream(final PrintStream stream) {
55  1 this.out = stream;
56    }
57   
 
58  2 toggle public void addModule(final QedeqBo prop) {
59  2 out.println(DateUtility.getTimestamp() + " Module added."
60    + "\n\t" + prop.getUrl());
61    }
62   
 
63  1 toggle public void stateChanged(final QedeqBo prop) {
64  1 out.println(DateUtility.getTimestamp() + " Module state changed. "
65    + prop.getStateDescription() + "\n\t" + prop.getUrl());
66    }
67   
 
68  1 toggle public void removeModule(final QedeqBo prop) {
69  1 out.println(DateUtility.getTimestamp() + " Module removed."
70    + "\n\t" + prop.getUrl());
71    }
72   
73    }