PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 37ms app.codeStats 0ms

/src/mpv5/db/common/DatabaseObjectModifier.java

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
Java | 69 lines | 10 code | 7 blank | 52 comment | 0 complexity | 44973cbc43ae1fc210b55eea614e029a MD5 | raw file
 1/*
 2 *  This file is part of YaBS.
 3 *
 4 *      YaBS is free software: you can redistribute it and/or modify
 5 *      it under the terms of the GNU General Public License as published by
 6 *      the Free Software Foundation, either version 3 of the License, or
 7 *      (at your option) any later version.
 8 *
 9 *      YaBS is distributed in the hope that it will be useful,
10 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
11 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 *      GNU General Public License for more details.
13 *
14 *      You should have received a copy of the GNU General Public License
15 *      along with YaBS.  If not, see <http://www.gnu.org/licenses/>.
16 */
17package mpv5.db.common;
18
19import java.util.HashMap;
20import mpv5.ui.panels.ChangeNotApprovedException;
21
22/**
23 * Any {@link MPPlugin} which implements this interface will be registered automatically to the modifiers.
24 * Any {@link DatabaseObject} will be passed through all DatabaseObjectModifiers <br/>
25 * registered with loaded {@link mpv5.pluginhandling.MP5Plugin}s.
26 * {@link mpv5.pluginhandling.MP5Plugin}s shall unregister from the {@link mpv5.pluginhandling.YabsPluginLoader} themselves on unload.
27 */
28public interface DatabaseObjectModifier {
29
30    /**
31     * This method will be called during construction of any {@link DatabaseObject} if this <br/>
32     * {@link DatabaseObjectModifier} is registered with a loaded  {@link mpv5.pluginhandling.MP5Plugin}
33     * @param object
34     * @return
35     */
36    DatabaseObject modifyOnExplode(DatabaseObject object);
37
38    /**
39     * This method will be called during saving of any {@link DatabaseObject} if this <br/>
40     * {@link DatabaseObjectModifier} is registered with a loaded  {@link mpv5.pluginhandling.MP5Plugin}
41     * @param object
42     * @return
43     */
44    DatabaseObject modifyOnSave(DatabaseObject object) throws ChangeNotApprovedException;
45
46     /**
47     * This method will be called after creation of any {@link DatabaseObject} if this <br/>
48     * {@link DatabaseObjectModifier} is registered with a loaded  {@link mpv5.pluginhandling.MP5Plugin}
49     * @param object
50     * @return
51     */
52    DatabaseObject modifyAfterCreate(DatabaseObject object);
53
54    /**
55     * This method will be called during reference-resolving any {@link DatabaseObject} if this <br/>
56     * {@link DatabaseObjectModifier} is registered with a loaded  {@link mpv5.pluginhandling.MP5Plugin}
57     * @param map
58     * @return
59     */
60    HashMap<String, Object> modifyOnResolve(HashMap<String, Object> map);
61
62    /**
63     * This method will be called during saving of any {@link DatabaseObject} if this <br/>
64     * {@link DatabaseObjectModifier} is registered with a loaded  {@link mpv5.pluginhandling.MP5Plugin}
65     * @param object
66     * @return
67     */
68    DatabaseObject modifyOnDelete(DatabaseObject object) throws ChangeNotApprovedException;
69}