src/main/java/org/jboss/util/property/MethodBoundPropertyListener.java
/**
    * Coerce and invoke the property setter method on the instance.
    *
    * @param value   Method value.
    *
    * @throws PropertyException     Failed to invoke setter method.
    */
Coerce and invoke the property setter method on the instance.
@param value   Method value.

@throws PropertyException     Failed to invoke setter method.
Coerce and invoke the property setter method on the instance . @param value Method value . @throws PropertyException Failed to invoke setter method .
protected void invokeSetter(String value) {
      try {
         Class<?> type = descriptor.getPropertyType();
         PropertyEditor editor = PropertyEditors.findEditor(type);
         editor.setAsText(value);
         Object coerced = editor.getValue();
         setter.invoke(instance, new Object[] { coerced });
      }
      catch (InvocationTargetException e) {
         Throwable target = e.getTargetException();
         if (target instanceof PropertyException) {
            throw (PropertyException)target;
         }
         else {
            throw new PropertyException(target);
         }
      }
      catch (Exception e) {
         throw new PropertyException(e);
      }
   }
protected void invokeSetter ( String value ) { try { Class < ? > type = descriptor . getPropertyType ( ) ; PropertyEditor editor = PropertyEditors . findEditor ( type ) ; editor . setAsText ( value ) ; Object coerced = editor . getValue ( ) ; setter . invoke ( instance , new Object [ ] { coerced } ) ; } catch ( InvocationTargetException e ) { Throwable target = e . getTargetException ( ) ; if ( target instanceof PropertyException ) { throw ( PropertyException ) target ; } else { throw new PropertyException ( target ) ; } } catch ( Exception e ) { throw new PropertyException ( e ) ; } }
Coerce and invoke the property setter method on the instance.
Coerce and invoke the property setter method on the instance .
// coerce value to field type // System.out.println("type: " + type); // System.out.println("coerced: " + coerced); // invoke the setter method