]> git.mxchange.org Git - jcore.git/blob - src/org/mxchange/jcore/BaseFrameworkSystem.java
Ignored some strings for internationalization + some debug messages added
[jcore.git] / src / org / mxchange / jcore / BaseFrameworkSystem.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.jcore;
18
19 import java.io.BufferedReader;
20 import java.io.FileInputStream;
21 import java.io.FileNotFoundException;
22 import java.io.IOException;
23 import java.io.InputStreamReader;
24 import java.io.PrintWriter;
25 import java.lang.reflect.Field;
26 import java.lang.reflect.InvocationTargetException;
27 import java.lang.reflect.Method;
28 import java.text.MessageFormat;
29 import java.util.Arrays;
30 import java.util.HashMap;
31 import java.util.Iterator;
32 import java.util.Map;
33 import java.util.Properties;
34 import java.util.ResourceBundle;
35 import java.util.StringTokenizer;
36 import org.apache.logging.log4j.LogManager;
37 import org.apache.logging.log4j.Logger;
38 import org.mxchange.jcore.application.Application;
39 import org.mxchange.jcore.client.Client;
40 import org.mxchange.jcore.contact.Contact;
41 import org.mxchange.jcore.database.backend.DatabaseBackend;
42 import org.mxchange.jcore.database.frontend.DatabaseFrontend;
43 import org.mxchange.jcore.manager.Manageable;
44
45 /**
46  * General class
47  *
48  * @author Roland Haeder
49  */
50 public class BaseFrameworkSystem implements FrameworkInterface {
51
52         /**
53          * Bundle instance
54          */
55         private static ResourceBundle bundle;
56
57         /**
58          * Instance for own properties
59          */
60         private static final Properties properties = new Properties(System.getProperties());
61
62         /**
63          * Self instance
64          */
65         private static FrameworkInterface selfInstance;
66
67         /**
68          * Class' logger
69          */
70         private final Logger LOG;
71
72         /**
73          * Application instance
74          */
75         private Application application;
76
77         /**
78          * Instance for database backend
79          */
80         private DatabaseBackend backend;
81
82         /**
83          * Client instance
84          */
85         private Client client;
86
87         /**
88          * Contact instance
89          */
90         private Contact contact;
91
92         /**
93          * Manager instance
94          */
95         private Manageable manager;
96
97         /**
98          * Name of used database table, handled over to backend
99          */
100         private String tableName;
101
102         /**
103          * DatabaseFrontend instance
104          */
105         private DatabaseFrontend wrapper;
106
107         /**
108          * Initialize object
109          */
110         {
111                 LOG = LogManager.getLogger(this);
112         }
113
114         /**
115          * No instances can be created of this class
116          */
117         protected BaseFrameworkSystem () {
118                 // Set own instance
119                 this.setSelfInstance();
120         }
121
122         /**
123          * Getter for this application
124          *
125          * @return Instance from this application
126          */
127         public static final FrameworkInterface getInstance () {
128                 // Return it
129                 return selfInstance;
130         }
131
132         /**
133          * Application instance
134          *
135          * @return the application
136          */
137         @Override
138         public final Application getApplication () {
139                 return this.application;
140         }
141
142         /**
143          * Getter for logger
144          *
145          * @return Logger
146          */
147         @Override
148         public final Logger getLogger () {
149                 return this.LOG;
150         }
151
152         /**
153          * Manager instance
154          *
155          * @return the contactManager
156          */
157         @Override
158         public final Manageable getManager () {
159                 return this.manager;
160         }
161
162         /**
163          * Getter for human-readable string from given key
164          *
165          * @param key Key to return
166          * @return Human-readable message
167          */
168         @Override
169         public final String getMessageStringFromKey (final String key) {
170                 // Return message
171                 return this.getBundle().getString(key);
172         }
173
174         /**
175          * Some "getter for a value from given column name. This name will be
176          * translated into a method name and then this method is called.
177          *
178          * @param columnName Column name
179          * @return Value from field
180          * @throws IllegalArgumentException Some implementations may throw this.
181          */
182         @Override
183         public Object getValueFromColumn (final String columnName) throws IllegalArgumentException {
184                 throw new UnsupportedOperationException(MessageFormat.format("Not implemented. columnName={0}", columnName)); //NOI18N
185         }
186
187         /**
188          * Some "getter" for target class instance from given name.
189          *
190          * @param instance Instance to iterate on
191          * @param targetClass Class name to look for
192          * @return Class instance
193          */
194         @SuppressWarnings ("unchecked")
195         private Class<? extends FrameworkInterface> getClassFromTarget (final FrameworkInterface instance, final String targetClass) {
196                 // Trace message
197                 this.getLogger().debug(MessageFormat.format("instance={0},targetClass={1}", instance, targetClass)); //NOI18N
198                 
199                 // Instance reflaction of this class
200                 Class<? extends FrameworkInterface> c = instance.getClass();
201                 
202                 // Analyze class
203                 while (!targetClass.equals(c.getSimpleName())) {
204                         // Debug message
205                         this.getLogger().debug(MessageFormat.format("c={0}", c.getSimpleName())); //NOI18N
206                         
207                         // Get super class (causes unchecked warning)
208                         c = (Class<? extends FrameworkInterface>) c.getSuperclass();
209                 }
210
211                 // Trace message
212                 this.getLogger().trace(MessageFormat.format("c={0} - EXIT!", c)); //NOI18N
213                 
214                 // Return it
215                 return c;
216         }
217
218         /**
219          * Some "getter" for a Method instance from given method name
220          *
221          * @param instance Actual instance to call
222          * @param targetClass Target class name
223          * @param methodName Method name
224          * @return A Method instance
225          */
226         private Method getMethodFromName (final FrameworkInterface instance, final String targetClass, final String methodName) {
227                 // Trace messahe
228                 this.getLogger().trace(MessageFormat.format("targetClass={0},methodName={1}", targetClass, methodName)); //NOI18N
229                 
230                 // Get target class instance
231                 Class<? extends FrameworkInterface> c = this.getClassFromTarget(instance, targetClass);
232                 
233                 // Init field instance
234                 Method method = null;
235                 
236                 // Use reflection to get all attributes
237                 try {
238                         method = c.getDeclaredMethod(methodName, new Class<?>[0]);
239                 } catch (final SecurityException | NoSuchMethodException ex) {
240                         // Security problem
241                         this.abortProgramWithException(ex);
242                 }
243                 
244                 // Assert on field
245                 assert (method instanceof Method) : "method is not a Method instance"; //NOI18N
246                 
247                 // Trace message
248                 this.getLogger().trace(MessageFormat.format("method={0} - EXIT!", method)); //NOI18N
249                 
250                 // Return it
251                 return method;
252         }
253
254         /**
255          * Setter for self instance
256          */
257         private void setSelfInstance () {
258                 // Need to set it here
259                 selfInstance = this;
260         }
261
262         /**
263          * Aborts program with given exception
264          *
265          * @param       throwable Any type of Throwable
266          */
267         protected final void abortProgramWithException (final Throwable throwable) {
268                 // Log exception ...
269                 this.getLogger().catching(throwable);
270                 
271                 // .. and exit
272                 System.exit(1);
273
274         }
275
276         /**
277          * Application instance
278          *
279          * @param application the application to set
280          */
281         protected final void setApplication (final Application application) {
282                 this.application = application;
283         }
284
285         /**
286          * Client instance
287          *
288          * @return the client
289          */
290         @Override
291         public final Client getClient () {
292                 return this.client;
293         }
294
295         /**
296          * Getter for bundle instance
297          *
298          * @return Resource bundle
299          */
300         protected final ResourceBundle getBundle () {
301                 return BaseFrameworkSystem.bundle;
302         }
303
304         /**
305          * Client instance
306          *
307          * @param client the client to set
308          */
309         protected final void setClient (final Client client) {
310                 this.client = client;
311         }
312
313         /**
314          * Name of used database table, handled over to backend
315          *
316          * @return the tableName
317          */
318         public final String getTableName () {
319                 return this.tableName;
320         }
321
322         /**
323          * Checks if given boolean field is available and set to same value
324          *
325          * @param columnName Column name to check
326          * @param bool Boolean value
327          * @return Whether all conditions are met
328          */
329         @Override
330         public boolean isValueEqual (final String columnName, final boolean bool) {
331                 // Not implemented
332                 throw new UnsupportedOperationException(MessageFormat.format("Not implemented. columnName={0},bool={1}", columnName, bool)); //NOI18N
333         }
334
335         /**
336          * Log exception
337          *
338          * @param exception Exception to log
339          */
340         @Override
341         public final void logException (final Throwable exception) {
342                 // Log this exception
343                 this.getLogger().catching(exception);
344         }
345
346         /**
347          * Initializes properties with default values
348          */
349         private void initPropertiesWithDefault () {
350                 // Trace message
351                 this.getLogger().trace("CALLED!"); //NOI18N
352
353                 // Init default values:
354                 // Default database backend
355                 BaseFrameworkSystem.properties.put("org.mxchange.database.backend.class", "org.mxchange.jcore.database.backend.base64.Base64CsvDatabaseBackend"); //NOI18N
356
357                 // For MySQL backend
358                 BaseFrameworkSystem.properties.put("org.mxchange.database.mysql.host", "localhost"); //NOI18N
359                 BaseFrameworkSystem.properties.put("org.mxchange.database.mysql.dbname", "test"); //NOI18N
360                 BaseFrameworkSystem.properties.put("org.mxchange.database.mysql.login", ""); //NOI18N
361                 BaseFrameworkSystem.properties.put("org.mxchange.database.mysql.password", ""); //NOI18N
362
363                 // Trace message
364                 this.getLogger().trace("EXIT!"); //NOI18N
365         }
366
367         /**
368          * Writes the properties file to disk
369          */
370         private void writePropertiesFile () {
371                 // Trace message
372                 this.getLogger().trace("CALLED!"); //NOI18N
373
374                 try {
375                         // Write it
376                         BaseFrameworkSystem.properties.store(new PrintWriter(FrameworkInterface.PROPERTIES_CONFIG_FILE), "This file is automatically generated. You may wish to alter it."); //NOI18N
377                 } catch (final IOException ex) {
378                         this.abortProgramWithException(ex);
379                 }
380
381                 // Trace message
382                 this.getLogger().trace("EXIT!"); //NOI18N
383         }
384
385         /**
386          * Converts a column name like "foo_bar" to an attribute name like "fooBar"
387          *
388          * @param columnName Column name to convert
389          * @return Attribute name
390          */
391         protected String convertColumnNameToAttribute (final String columnName) {
392                 // Trace message
393                 this.getLogger().trace(MessageFormat.format("columnName={0} - CALLED!", columnName)); //NOI18N
394
395                 // First all lower case
396                 String lower = columnName.toLowerCase();
397
398                 // Then split on "_"
399                 StringTokenizer tokenizer = new StringTokenizer(lower, "_"); //NOI18N
400
401                 // Resulting string
402                 StringBuilder builder = new StringBuilder(tokenizer.countTokens());
403
404                 // Init counter
405                 int count = 0;
406
407                 // Walk through all
408                 while (tokenizer.hasMoreTokens()) {
409                         // Get token
410                         String token = tokenizer.nextToken();
411
412                         // Is later than first element?
413                         if (count > 0) {
414                                 // Make first character upper-case
415                                 char c = token.charAt(0);
416                                 token = String.valueOf(c).toUpperCase() + token.substring(1);
417                         }
418
419                         // Add token
420                         builder.append(token);
421
422                         // Increment counter
423                         count++;
424                 }
425
426                 // Trace message
427                 this.getLogger().trace(MessageFormat.format("builder={0} - EXIT!", builder)); //NOI18N
428
429                 // Return result
430                 return builder.toString();
431         }
432
433         /**
434          * Converts a column name like "foo_bar" to a method name like "getFooBar"
435          * for non-booleans and to "isFooBar" for boolean fields.
436          *
437          * @param columnName Column name to convert
438          * @param isBool Whether the parameter is boolean
439          * @return Attribute name
440          */
441         protected String convertColumnNameToGetterMethod (final String columnName, boolean isBool) {
442                 // Trace message
443                 this.getLogger().trace(MessageFormat.format("columnName={0} - CALLED!", columnName)); //NOI18N
444
445                 // Then split on "_"
446                 StringTokenizer tokenizer = new StringTokenizer(columnName, "_"); //NOI18N
447
448                 // Resulting string
449                 StringBuilder builder = new StringBuilder(tokenizer.countTokens());
450
451                 // Is it boolean?
452                 if (isBool) {
453                         // Append "is"
454                         builder.append("is"); //NOI18N
455                 } else {
456                         // Append "get"
457                         builder.append("get"); //NOI18N
458                 }
459
460                 // Walk through all
461                 while (tokenizer.hasMoreTokens()) {
462                         // Get token
463                         String token = tokenizer.nextToken();
464
465                         // Debug message
466                         this.getLogger().debug(MessageFormat.format("token={0}", token)); //NOI18N
467
468                         // Make it upper-case
469                         char c = token.charAt(0);
470                         token = String.valueOf(c).toUpperCase() + token.substring(1);
471
472                         // Add token
473                         builder.append(token);
474                 }
475
476                 // Trace message
477                 this.getLogger().trace(MessageFormat.format("builder={0} - EXIT!", builder)); //NOI18N
478
479                 // Return result
480                 return builder.toString();
481         }
482
483         /**
484          * Some "getter" for an array from given string and tokenizer
485          *
486          * @param str String to tokenize and get array from
487          * @param delimiter Delimiter
488          * @param size Size of array
489          * @return Array from tokenized string
490          * @todo Get rid of size parameter
491          */
492         protected String[] getArrayFromString (final String str, final String delimiter, final int size) {
493                 // Trace message
494                 this.getLogger().trace(MessageFormat.format("str={0},delimiter={1},size={2} - CALLED!", str, delimiter, size)); //NOI18N
495
496                 // Get tokenizer
497                 StringTokenizer tokenizer = new StringTokenizer(str, delimiter);
498
499                 // Init array and index
500                 String[] tokens = new String[size];
501                 int index = 0;
502
503                 // Run through all tokens
504                 while (tokenizer.hasMoreTokens()) {
505                         // Get current token and add it
506                         tokens[index] = tokenizer.nextToken();
507
508                         // Debug message
509                         this.getLogger().debug(MessageFormat.format("Token at index{0}: {1}", index, tokens[1])); //NOI18N
510
511                         // Increment index
512                         index++;
513                 }
514
515                 // Trace message
516                 this.getLogger().trace(MessageFormat.format("tokens({0})={1} - EXIT!", tokens.length, Arrays.toString(tokens))); //NOI18N
517
518                 // Return it
519                 return tokens;
520         }
521
522         /**
523          * Returns boolean field value from given method name by invoking it
524          *
525          * @param instance The instance to call
526          * @param targetClass Target class to look in
527          * @param methodName Method name to look for
528          * @return Boolean value from field
529          */
530         protected boolean getBooleanField (final FrameworkInterface instance, final String targetClass, final String methodName) {
531                 // Trace messahe
532                 this.getLogger().trace(MessageFormat.format("targetClass={0},methodName={1}", targetClass, methodName)); //NOI18N
533
534                 // Get method instance
535                 Method method = this.getMethodFromName(instance, targetClass, methodName);
536
537                 // Get value from field
538                 Boolean value = false;
539
540                 try {
541                         value = (Boolean) method.invoke(instance);
542                 } catch (final IllegalArgumentException | IllegalAccessException | InvocationTargetException ex) {
543                         // Other problem
544                         this.abortProgramWithException(ex);
545                 }
546
547                 // Return value
548                 return value;
549         }
550
551         /**
552          * Manager instance
553          *
554          * @param manager the manager instance to set
555          */
556         protected final void setContactManager (final Manageable manager) {
557                 this.manager = manager;
558         }
559
560         /**
561          * Returns any field value from given method name by invoking it
562          *
563          * @param instance The instance to call
564          * @param targetClass Target class to look in
565          * @param methodName Method name to look for
566          * @return Any value from field
567          */
568         protected Object getField (final FrameworkInterface instance, final String targetClass, final String methodName) {
569                 // Trace messahe
570                 this.getLogger().trace(MessageFormat.format("targetClass={0},methodName={1}", targetClass, methodName)); //NOI18N
571                 
572                 // Get method to call
573                 Method method = this.getMethodFromName(instance, targetClass, methodName);
574                 
575                 // Get value from field
576                 Object object = null;
577                 
578                 try {
579                         object = method.invoke(instance);
580                 } catch (final IllegalArgumentException | IllegalAccessException | InvocationTargetException ex) {
581                         // Other problem
582                         this.abortProgramWithException(ex);
583                 }
584
585                 // Return value
586                 return object;
587         }
588
589         /**
590          * Getter for property which must exist
591          *
592          * @param key Key to get
593          * @return Propety value
594          */
595         protected final String getProperty (final String key) {
596                 return BaseFrameworkSystem.properties.getProperty(String.format("org.mxchange.%s", key)); //NOI18N
597         }
598
599         /**
600          * Name of used database table, handled over to backend
601          *
602          * @param tableName the tableName to set
603          */
604         protected final void setTableName (final String tableName) {
605                 this.tableName = tableName;
606         }
607
608         /**
609          * Converts null to empty string or leaves original string.
610          *
611          * @param str Any string
612          * @return Empty string if null or original string
613          */
614         protected Object convertNullToEmpty (final Object str) {
615                 // Trace message
616                 this.getLogger().trace(MessageFormat.format("str={0}", str)); //NOI18N
617                 
618                 // Is it null?
619                 if (str == null) {
620                         // Return empty string
621                         return ""; //NOI18N
622                 }
623
624                 // Trace message
625                 this.getLogger().trace(MessageFormat.format("str={0} - EXIT!", str)); //NOI18N
626                 
627                 // Return it
628                 return str;
629         }
630
631         /**
632          * Creates an iterator from given instance and class name.
633          *
634          * @param instance Instance to run getter calls on
635          * @param className Class name to iterate over
636          * @return An iterator over all object's fields
637          */
638         protected Iterator<Map.Entry<Field, Object>> fieldIterator (final FrameworkInterface instance, final String className) {
639                 // Trace message
640                 this.getLogger().trace(MessageFormat.format("instance={0},className={1} - CALLED!", instance, className)); //NOI18N
641
642                 // Get all attributes from given instance
643                 Field[] fields = this.getClassFromTarget(instance, className).getDeclaredFields();
644
645                 // Debug message
646                 this.getLogger().debug(MessageFormat.format("Found {0} fields.", fields.length)); //NOI18N
647
648                 // A simple map with K=fieldName and V=Value is fine
649                 Map<Field, Object> map = new HashMap<>(fields.length);
650
651                 // Walk through all
652                 for (final Field field : fields) {
653                         // Debug log
654                         this.getLogger().debug(MessageFormat.format("field={0}", field.getName())); //NOI18N
655
656                         // Does the field start with "$"?
657                         if (field.getName().startsWith("$")) { //NOI18N
658                                 // Debug message
659                                 this.getLogger().debug(MessageFormat.format("Skipping field={0} as it starts with a dollar character.", field.getName())); //NOI18N
660
661                                 // Skip it silently
662                                 continue;
663                         }
664
665                         // Debug message
666                         this.getLogger().debug(MessageFormat.format("Calling getValueFromColumn({0}) on instance {1} ...", field.getName(), instance));
667
668                         // Get value from it
669                         Object value = instance.getValueFromColumn(field.getName());
670
671                         // Debug message
672                         this.getLogger().debug(MessageFormat.format("Adding field={0},value={1}", field.getName(), value)); //NOI18N
673
674                         // Add it to list
675                         map.put(field, value);
676                 }
677
678                 // Debug message
679                 this.getLogger().debug(MessageFormat.format("Returning iterator for {0} entries ...", map.size())); //NOI18N
680
681                 // Return list iterator
682                 return map.entrySet().iterator();
683         }
684
685         /**
686          * Instance for database backend
687          *
688          * @return the backend
689          */
690         protected final DatabaseBackend getBackend () {
691                 return this.backend;
692         }
693
694         /**
695          * Instance for database backend
696          *
697          * @param backend the backend to set
698          */
699         protected final void setBackend (final DatabaseBackend backend) {
700                 this.backend = backend;
701         }
702
703         /**
704          * Getter for Contact instance
705          *
706          * @return Contact instance
707          */
708         protected final Contact getContact () {
709                 return this.contact;
710         }
711
712         /**
713          * Setter for Contact instance
714          *
715          * @param contact A Contact instance
716          */
717         protected final void setContact (final Contact contact) {
718                 this.contact = contact;
719         }
720
721         /**
722          * Getter for DatabaseFrontend instance
723          *
724          * @return DatabaseFrontend instance
725          */
726         protected final DatabaseFrontend getFrontend () {
727                 return this.wrapper;
728         }
729
730         /**
731          * Setter for wrapper instance
732          *
733          * @param wrapper A DatabaseFrontend instance
734          */
735         protected final void setFrontend (final DatabaseFrontend wrapper) {
736                 this.wrapper = wrapper;
737         }
738
739         /**
740          * Initializes i18n bundles
741          */
742         protected void initBundle () {
743                 // Is the bundle set?
744                 if (bundle instanceof ResourceBundle) {
745                         // Is already set
746                         throw new IllegalStateException("called twice"); //NOI18N
747                 }
748
749                 // Set instance
750                 bundle = ResourceBundle.getBundle(FrameworkInterface.I18N_BUNDLE_FILE); // NOI18N
751         }
752         
753         /**
754          * Prepares all properties, the file is written if it is not found
755          */
756         protected void initProperties () {
757                 // Trace message
758                 this.getLogger().trace("CALLED!"); //NOI18N
759
760                 // Debug message
761                 this.getLogger().debug(MessageFormat.format("{0} properties are loaded already.", BaseFrameworkSystem.properties.size())); //NOI18N
762
763                 // Are some properties loaded?
764                 if (!BaseFrameworkSystem.properties.isEmpty()) {
765                         // Some are already loaded, abort here
766                         return;
767                 }
768
769                 try {
770                         // Try to read it
771                         BaseFrameworkSystem.properties.load(new BufferedReader(new InputStreamReader(new FileInputStream(FrameworkInterface.PROPERTIES_CONFIG_FILE))));
772
773                         // Debug message
774                         this.getLogger().debug(MessageFormat.format("{0} properties has been loaded.", BaseFrameworkSystem.properties.size())); //NOI18N
775                 } catch (final FileNotFoundException ex) {
776                         // Debug message
777                         this.getLogger().debug(MessageFormat.format("Properties file {0} not found: {1}", FrameworkInterface.PROPERTIES_CONFIG_FILE, ex)); //NOI18N
778
779                         /*
780                          * The file is not found which is normal for first run, so
781                          * initialize default values.
782                          */
783                         this.initPropertiesWithDefault();
784
785                         // Write file
786                         this.writePropertiesFile();
787                 } catch (final IOException ex) {
788                         // Something else didn't work
789                         this.abortProgramWithException(ex);
790                 }
791
792                 // Trace message
793                 this.getLogger().trace("EXIT!"); //NOI18N
794         }
795
796         /**
797          * Checks whether the given field is a boolean field by probing it.
798          *
799          * @param instance Instance to call
800          * @param targetClass Target class
801          * @param columnName Column name to check
802          * @return Whether the given column name represents a boolean field
803          */
804         protected boolean isBooleanField (final FrameworkInterface instance, final String targetClass, final String columnName) {
805                 // Trace message
806                 this.getLogger().trace(MessageFormat.format("instance={0},targetCLass={1},columnName={2} - CALLED!", instance, targetClass, columnName)); //NOI18N
807
808                 // Convert column name to getter name (boolean)
809                 String methodName = this.convertColumnNameToGetterMethod(columnName, true);
810
811                 // Get class instance
812                 Class<? extends FrameworkInterface> c = this.getClassFromTarget(instance, targetClass);
813
814                 // Defauzlt is boolean
815                 boolean isBool = true;
816
817                 try {
818                         // Now try to instance the method
819                         Method method = c.getDeclaredMethod(methodName, new Class<?>[0]);
820                 } catch (final NoSuchMethodException ex) {
821                         // Debug message
822                         this.getLogger().debug(MessageFormat.format("Method {0} does not exist, field {1} cannot be boolean: {2}", methodName, columnName, ex)); //NOI18N
823
824                         // Not found
825                         isBool = false;
826                 } catch (final SecurityException ex) {
827                         // Really bad?
828                         this.abortProgramWithException(ex);
829                 }
830
831                 // Trace message
832                 this.getLogger().trace(MessageFormat.format("isBool={0} - EXIT!", isBool)); //NOI18N
833
834                 // Return result
835                 return isBool;
836         }
837
838 }