+
+ /**
+ * Some "getter" for an array from given string and tokenizer
+ *
+ * @param str String to tokenize and get array from
+ * @param delimiter Delimiter
+ * @param size Size of array
+ * @return Array from tokenized string
+ */
+ protected String[] getArrayFromString (final String str, final String delimiter, final int size) {
+ // Trace message
+ this.getLogger().trace(MessageFormat.format("str={0},delimiter={1},size={2} - CALLED!", str, delimiter, size));
+
+ // Get tokenizer
+ StringTokenizer tokenizer = new StringTokenizer(str, delimiter);
+
+ // Init array and index
+ String[] tokens = new String[size];
+ int index = 0;
+
+ // Run through all tokens
+ while (tokenizer.hasMoreTokens()) {
+ // Get current token and add it
+ tokens[index] = tokenizer.nextToken();
+
+ // Debug message
+ this.getLogger().debug(MessageFormat.format("Token at index{0}: {1}", index, tokens[1]));
+
+ // Increment index
+ index++;
+ }
+
+ // Trace message
+ this.getLogger().trace(MessageFormat.format("tokens({0})={1} - EXIT!", tokens.length, Arrays.toString(tokens)));
+
+ // Return it
+ return tokens;
+ }
+
+ /**
+ * Checks whether the given field is a boolean field by probing it.
+ *
+ * @param instance Instance to call
+ * @param targetClass Target class
+ * @param columnName Column name to check
+ * @return Whether the given column name represents a boolean field
+ */
+ protected boolean isBooleanField (final FrameworkInterface instance, final String targetClass, final String columnName) {
+ // Trace message
+ this.getLogger().trace(MessageFormat.format("instance={0},targetCLass={1},columnName={2} - CALLED!", instance, targetClass, columnName));
+
+ // Convert column name to getter name (boolean)
+ String methodName = this.convertColumnNameToGetterMethod(columnName, true);
+
+ // Get class instance
+ Class<? extends FrameworkInterface> c = this.getClassFromTarget(instance, targetClass);
+
+ // Defauzlt is boolean
+ boolean isBool = true;
+
+ try {
+ // Now try to instance the method
+ Method method = c.getDeclaredMethod(methodName, new Class<?>[0]);
+ } catch (final NoSuchMethodException ex) {
+ // Debug message
+ this.getLogger().debug(MessageFormat.format("Method {0} does not exist, field {1} cannot be boolean: {2}", methodName, columnName, ex));
+
+ // Not found
+ isBool = false;
+ } catch (final SecurityException ex) {
+ // Really bad?
+ this.abortProgramWithException(ex);
+ }
+
+ // Trace message
+ this.getLogger().trace(MessageFormat.format("isBool={0} - EXIT!", isBool));
+
+ // Return result
+ return isBool;
+ }