]> git.mxchange.org Git - jcore-utils.git/blob - src/org/mxchange/jcoreee/beans/BaseFrameworkBean.java
Updated author (email address) + updated jars
[jcore-utils.git] / src / org / mxchange / jcoreee / beans / BaseFrameworkBean.java
1 /*
2  * Copyright (C) 2015 Roland Haeder
3  *
4  * This program 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  * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 package org.mxchange.jcoreee.beans;
18
19 import java.io.Serializable;
20 import java.util.ResourceBundle;
21
22 /**
23  * A general bean class. Do not put things in here that are not serializable.
24  * The logger is currently not serializable, so you will get error messages.
25  *
26  * @author Roland Haeder<roland@mxchange.org>
27  */
28 public abstract class BaseFrameworkBean implements Serializable {
29
30         /**
31          * Serial number
32          */
33         private static final long serialVersionUID = 83_258_139_481_372_814L;
34
35         /**
36          * Resource bundle
37          */
38         private ResourceBundle bundle;
39
40         /**
41          * Protected constructor, please don't add init() call here.
42          */
43         protected BaseFrameworkBean () {
44         }
45
46         /**
47          * Super initialization method. If you overwrite this method, please call it
48          * before (!) your own initialization.
49          *
50          * @throws RuntimeException If something unexpected happens
51          */
52         protected void genericInit () throws RuntimeException {
53                 // Init resource bundle
54                 this.bundle = ResourceBundle.getBundle("org/mxchange/localization/bundle");
55         }
56
57         /**
58          * Getter for localized message from key
59          *
60          * @param key Key for message
61          * @return Localized message
62          */
63         protected String getMessage (final String key) {
64                 return this.bundle.getString(key);
65         }
66 }