]> git.mxchange.org Git - jcore.git/blobdiff - src/org/mxchange/jcore/BaseFrameworkSystem.java
auto-formatted project
[jcore.git] / src / org / mxchange / jcore / BaseFrameworkSystem.java
index 335af7aa89afb389202f167dd0197dbafd82e810..960f3569a09023c0b74532110c27fc8dcddc8c3c 100644 (file)
@@ -29,8 +29,8 @@ import org.mxchange.jcore.model.contact.Contact;
 
 /**
  * General class
- *
- * @author Roland Haeder
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
  */
 public abstract class BaseFrameworkSystem implements FrameworkInterface {
 
@@ -88,7 +88,7 @@ public abstract class BaseFrameworkSystem implements FrameworkInterface {
 
        /**
         * Getter for this application
-        *
+        * <p>
         * @return Instance from this application
         */
        public static FrameworkInterface getInstance () {
@@ -101,93 +101,48 @@ public abstract class BaseFrameworkSystem implements FrameworkInterface {
                return this.application;
        }
 
-       /**
-        * Getter for logger instance
-        *
-        * @return Logger instance
-        */
-       protected Logger getLogger () {
-               return this.LOG;
-       }
-
-       @Override
-       public Manageable getManager () {
-               return this.manager;
-       }
-
-       @Override
-       public String getMessageStringFromKey (final String key) {
-               // Return message
-               return this.getBundle().getString(key);
-       }
-
-       /**
-        * Aborts program with given exception
-        *
-        * @param throwable Any type of Throwable
-        */
-       protected void abortProgramWithException (final Throwable throwable) {
-               // Log exception ...
-               this.logException(throwable);
-
-               // .. and exit
-               System.exit(1);
-       }
-
-       /**
-        * Application instance
-        *
-        * @param application the application to set
-        */
-       protected void setApplication (final Application application) {
-               this.application = application;
-       }
-
        @Override
        public Client getClient () {
                return this.client;
        }
 
-       /**
-        * Getter for bundle instance
-        *
-        * @return Resource bundle
-        */
-       protected ResourceBundle getBundle () {
-               return BaseFrameworkSystem.bundle;
+       @Override
+       public void logException (final Throwable exception) {
+               // Log this exception
+               this.getLogger().catching(exception);
        }
 
        /**
-        * Setter for bundle instance
-        *
-        * @param bundle the bundle to set
+        * Converts null to empty string or leaves original object untouched.
+        * <p>
+        * @param object Any string
+        * @return Empty string if null or original string TODO: Move to own utility
+        * class
         */
-       protected static void setBundle (final ResourceBundle bundle) {
-               BaseFrameworkSystem.bundle = bundle;
-       }
+       protected Object convertNullToEmpty (final Object object) {
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("object={0}", object)); //NOI18N
 
-       /**
-        * Client instance
-        *
-        * @param client the client to set
-        */
-       protected void setClient (final Client client) {
-               this.client = client;
-       }
+               // Is it null?
+               if (null == object) {
+                       // Return empty string
+                       return ""; //NOI18N
+               }
 
-       @Override
-       public void logException (final Throwable exception) {
-               // Log this exception
-               this.getLogger().catching(exception);
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("object={0} - EXIT!", object)); //NOI18N
+
+               // Return it
+               return object;
        }
 
        /**
         * Some "getter" for an array from given string and tokenizer
-        *
+        * <p>
         * @param str String to tokenize and get array from
         * @param delimiter Delimiter
-        * @return Array from tokenized string TODO Get rid of size parameter
-        * TODO: Move to own utility class
+        * @return Array from tokenized string TODO Get rid of size parameter TODO:
+        * Move to own utility class
         */
        protected String[] getArrayFromString (final String str, final String delimiter) {
                // Trace message
@@ -220,41 +175,31 @@ public abstract class BaseFrameworkSystem implements FrameworkInterface {
        }
 
        /**
-        * Converts null to empty string or leaves original object untouched.
-        *
-        * @param object Any string
-        * @return Empty string if null or original string
-        * TODO: Move to own utility class
+        * Client instance
+        * <p>
+        * @param client the client to set
         */
-       protected Object convertNullToEmpty (final Object object) {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("object={0}", object)); //NOI18N
-
-               // Is it null?
-               if (null == object) {
-                       // Return empty string
-                       return ""; //NOI18N
-               }
-
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("object={0} - EXIT!", object)); //NOI18N
-
-               // Return it
-               return object;
+       protected void setClient (final Client client) {
+               this.client = client;
        }
 
        /**
-        * Manager instance
-        *
-        * @param manager the manager instance to set
+        * Application instance
+        * <p>
+        * @param application the application to set
         */
-       protected void setManager (final Manageable manager) {
-               this.manager = manager;
+       protected void setApplication (final Application application) {
+               this.application = application;
+       }
+
+       @Override
+       public Manageable getManager () {
+               return this.manager;
        }
 
        /**
         * Getter for Contact instance
-        *
+        * <p>
         * @return Contact instance
         */
        protected Contact getContact () {
@@ -263,13 +208,68 @@ public abstract class BaseFrameworkSystem implements FrameworkInterface {
 
        /**
         * Setter for Contact instance
-        *
+        * <p>
         * @param contact A Contact instance
         */
        protected void setContact (final Contact contact) {
                this.contact = contact;
        }
 
+       /**
+        * Manager instance
+        * <p>
+        * @param manager the manager instance to set
+        */
+       protected void setManager (final Manageable manager) {
+               this.manager = manager;
+       }
+
+       @Override
+       public String getMessageStringFromKey (final String key) {
+               // Return message
+               return this.getBundle().getString(key);
+       }
+
+       /**
+        * Aborts program with given exception
+        * <p>
+        * @param throwable Any type of Throwable
+        */
+       protected void abortProgramWithException (final Throwable throwable) {
+               // Log exception ...
+               this.logException(throwable);
+
+               // .. and exit
+               System.exit(1);
+       }
+
+       /**
+        * Getter for bundle instance
+        * <p>
+        * @return Resource bundle
+        */
+       protected ResourceBundle getBundle () {
+               return BaseFrameworkSystem.bundle;
+       }
+
+       /**
+        * Setter for bundle instance
+        * <p>
+        * @param bundle the bundle to set
+        */
+       protected static void setBundle (final ResourceBundle bundle) {
+               BaseFrameworkSystem.bundle = bundle;
+       }
+
+       /**
+        * Getter for logger instance
+        * <p>
+        * @return Logger instance
+        */
+       protected Logger getLogger () {
+               return this.LOG;
+       }
+
        /**
         * Initializes i18n bundles
         */
@@ -292,7 +292,7 @@ public abstract class BaseFrameworkSystem implements FrameworkInterface {
 
        /**
         * Checks if the bundle is initialized
-        *
+        * <p>
         * @return Whether the bundle has been initialized
         */
        protected static boolean isBundledInitialized () {