PageRenderTime 179ms CodeModel.GetById 162ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-3.0, Apache-2.0, GPL-3.0, GPL-2.0, AGPL-3.0, JSON, BSD-3-Clause
  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. */
  17. package mpv5.db.common;
  18. import java.util.HashMap;
  19. import mpv5.ui.panels.ChangeNotApprovedException;
  20. /**
  21. * Any {@link MPPlugin} which implements this interface will be registered automatically to the modifiers.
  22. * Any {@link DatabaseObject} will be passed through all DatabaseObjectModifiers <br/>
  23. * registered with loaded {@link mpv5.pluginhandling.MP5Plugin}s.
  24. * {@link mpv5.pluginhandling.MP5Plugin}s shall unregister from the {@link mpv5.pluginhandling.YabsPluginLoader} themselves on unload.
  25. */
  26. public interface DatabaseObjectModifier {
  27. /**
  28. * This method will be called during construction of any {@link DatabaseObject} if this <br/>
  29. * {@link DatabaseObjectModifier} is registered with a loaded {@link mpv5.pluginhandling.MP5Plugin}
  30. * @param object
  31. * @return
  32. */
  33. DatabaseObject modifyOnExplode(DatabaseObject object);
  34. /**
  35. * This method will be called during saving of any {@link DatabaseObject} if this <br/>
  36. * {@link DatabaseObjectModifier} is registered with a loaded {@link mpv5.pluginhandling.MP5Plugin}
  37. * @param object
  38. * @return
  39. */
  40. DatabaseObject modifyOnSave(DatabaseObject object) throws ChangeNotApprovedException;
  41. /**
  42. * This method will be called after creation of any {@link DatabaseObject} if this <br/>
  43. * {@link DatabaseObjectModifier} is registered with a loaded {@link mpv5.pluginhandling.MP5Plugin}
  44. * @param object
  45. * @return
  46. */
  47. DatabaseObject modifyAfterCreate(DatabaseObject object);
  48. /**
  49. * This method will be called during reference-resolving any {@link DatabaseObject} if this <br/>
  50. * {@link DatabaseObjectModifier} is registered with a loaded {@link mpv5.pluginhandling.MP5Plugin}
  51. * @param map
  52. * @return
  53. */
  54. HashMap<String, Object> modifyOnResolve(HashMap<String, Object> map);
  55. /**
  56. * This method will be called during saving of any {@link DatabaseObject} if this <br/>
  57. * {@link DatabaseObjectModifier} is registered with a loaded {@link mpv5.pluginhandling.MP5Plugin}
  58. * @param object
  59. * @return
  60. */
  61. DatabaseObject modifyOnDelete(DatabaseObject object) throws ChangeNotApprovedException;
  62. }