]> git.mxchange.org Git - jcore.git/commitdiff
Changed parameter type from String to Object + implemented one setter
authorRoland Haeder <roland@mxchange.org>
Fri, 14 Aug 2015 19:48:53 +0000 (21:48 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 14 Aug 2015 19:48:53 +0000 (21:48 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jcore/BaseFrameworkSystem.java
src/org/mxchange/jcore/contact/BaseContact.java
src/org/mxchange/jcore/database/storage/Storeable.java

index f6a1cb5ff98ccb123acb378775119cb3478ff8eb..2dd9dd2daecb1b36c871f7329352db986e40260c 100644 (file)
@@ -680,7 +680,7 @@ public class BaseFrameworkSystem implements FrameworkInterface {
         * @throws java.lang.IllegalAccessException If the method cannot be accessed
         * @throws java.lang.reflect.InvocationTargetException Some other problems?
         */
-       protected void setField (final FrameworkInterface instance, final String targetClass, final String methodName, final String value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+       protected void setField (final FrameworkInterface instance, final String targetClass, final String methodName, final Object value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
                // Trace messahe
                this.getLogger().trace(MessageFormat.format("targetClass={0},methodName={1},value={2}", targetClass, methodName, value)); //NOI18N
 
@@ -1005,7 +1005,7 @@ public class BaseFrameworkSystem implements FrameworkInterface {
         * @throws java.lang.IllegalAccessException If the setter cannot be accessed
         * @throws java.lang.reflect.InvocationTargetException Any other problem?
         */
-       protected void setValueInStoreableFromColumn (final Storeable instance, final String targetClass, final String columnName, final String value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+       protected void setValueInStoreableFromColumn (final Storeable instance, final String targetClass, final String columnName, final Object value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
                // Trace message
                this.getLogger().trace("instance=" + instance + ",targetClass=" + targetClass + ",columnName=" + columnName + ",value=" + value + " - CALLED!");
 
@@ -1021,7 +1021,7 @@ public class BaseFrameworkSystem implements FrameworkInterface {
                        this.getLogger().debug("Column " + columnName + " represents a boolean field.");
 
                        // Yes, then call other method
-                       this.setBooleanField(instance, targetClass, this.convertColumnNameToSetterMethod(columnName), Boolean.parseBoolean(value));
+                       this.setBooleanField(instance, targetClass, this.convertColumnNameToSetterMethod(columnName), (Boolean) value);
                }
 
                // Convert column name to field name
index cb9232ddeb03f20d369d1def4c136b59cc2cae2f..71a7d30021e3531f0526a87fd5661fc1643d6fc6 100644 (file)
@@ -606,7 +606,14 @@ public class BaseContact extends BaseFrameworkSystem implements Contact {
        }
 
        @Override
-       public void setValueFromColumn (final String columnName, String value) {
-               throw new UnsupportedOperationException("Not supported yet: columnName=" + columnName + ",value=" + value);
+       public void setValueFromColumn (final String columnName, final Object value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("columnName={0},value={1} - CALLED!", columnName, value));
+
+               // Call super method
+               this.setValueInStoreableFromColumn(this, "BaseContact", columnName, value);
+
+               // Trace message
+               this.getLogger().trace("EXIT!");
        }
 }
index 42d7b43cd5e1406a42edd2cb0316b0e04d0c8324..f412bccf7d2e01192ce5fa65a89585e0347b14da 100644 (file)
@@ -49,5 +49,5 @@ public interface Storeable extends FrameworkInterface {
         * @throws java.lang.IllegalAccessException If the method cannot be accessed
         * @throws java.lang.reflect.InvocationTargetException Any other problems?
         */
-       public void setValueFromColumn (final String columnName, final String value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException;
+       public void setValueFromColumn (final String columnName, final Object value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException;
 }