@@ -122,6 +122,14 @@ public static Object getProperty(final Object bean, final String propName) throw
122
122
// ------------------------------------------------------------------------
123
123
124
124
/**
125
+ * Set a property value of an object.
126
+ *
127
+ * @param target Target Object
128
+ * @param propName name of the Object Property
129
+ * @param propType type of the Object Property
130
+ * @param propValue Value of the property to be set
131
+ *
132
+ * @throws Exception exceptions when invoking the accessor methods
125
133
*/
126
134
public static void setProperty (final Object target , final String propName , final Class <?> propType ,
127
135
final Object propValue ) throws Exception {
@@ -130,30 +138,34 @@ public static void setProperty(final Object target, final String propName, final
130
138
return ; // Skip Setter if property value is NULL
131
139
}
132
140
133
- try {
134
- // Convert the specified value to the required type
135
- final Object newValue ;
136
- if (propValue instanceof String ) {
137
- newValue = CONVERT_UTILS_BEAN .convert ((String ) propValue , propType );
141
+ // Convert the specified value to the required type
142
+ final Object newValue ;
143
+ if (propValue instanceof String ) {
144
+ newValue = CONVERT_UTILS_BEAN .convert ((String ) propValue , propType );
145
+ } else {
146
+ final Converter converter = CONVERT_UTILS_BEAN .lookup (propType );
147
+ if (converter != null ) {
148
+ newValue = converter .convert (propType , propValue );
138
149
} else {
139
- final Converter converter = CONVERT_UTILS_BEAN .lookup (propType );
140
- if (converter != null ) {
141
- newValue = converter .convert (propType , propValue );
142
- } else {
143
- newValue = propValue ;
144
- }
150
+ newValue = propValue ;
145
151
}
146
-
147
- // Invoke the setter method
148
- PROP_UTILS_BEAN .setProperty (target , propName , newValue );
149
-
150
- } catch (Exception ex ) {
151
- //
152
152
}
153
+
154
+ // Invoke the setter method
155
+ PROP_UTILS_BEAN .setProperty (target , propName , newValue );
153
156
}
154
157
155
158
156
159
/**
160
+ * Set a property value of an object.
161
+ *
162
+ * @param target Target Object
163
+ * @param propName name of the Object Property
164
+ * @param propValue Value of the property to be set
165
+ * @param format Value format
166
+ * @param dateTimeType {@link DateTimeType} value for Date/Time properties
167
+ *
168
+ * @throws Exception exceptions when invoking the accessor methods
157
169
*/
158
170
@ SuppressWarnings ({"unchecked" , "rawtypes" })
159
171
public static void setProperty (final Object target , final String propName , final Object propValue ,
@@ -206,6 +218,15 @@ public static void setProperty(final Object target, final String propName, final
206
218
207
219
/**
208
220
* Set the Date/Time property of the Target Bean.
221
+ *
222
+ * @param target Target Object
223
+ * @param propName name of the Object Property
224
+ * @param propType type of the Object Property
225
+ * @param propValue Value of the property to be set
226
+ * @param format Value format
227
+ * @param dateTimeType {@link DateTimeType} value for Date/Time properties
228
+ *
229
+ * @throws Exception exceptions when invoking the accessor methods
209
230
*/
210
231
private static void setDateTimeProperty (final Object target , final String propName , final Class <?> propType ,
211
232
final Object propValue , final String format , final DateTimeType dateTimeType ) throws Exception {
0 commit comments