public void apply(Object target, WireContext wireContext) { // create the value to assign to the property Object value = wireContext.create(descriptor, true); Method method = null; Class<?> clazz = target.getClass(); Object[] args = new Object[] { value }; method = ReflectUtilDescriptor.findMethod(clazz, setterName, null, args); if (method == null) { String message = ExceptionManager.getInstance().getFullMessage( "bp_PO_1", setterName, value); throw new WireException(message); } ReflectUtil.invoke(method, target, args); }
public void event(Object source, String eventName, Object info) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("invoking " + methodName + " on " + target + " for event " + eventName); } try { Object[] args = ObjectDescriptor.getArgs(wireContext, argDescriptors); Class<?> clazz = target.getClass(); Method method = ReflectUtilDescriptor.findMethod(clazz, methodName, argDescriptors, args); if (method == null) { String message = ExceptionManager.getInstance().getFullMessage( "bp_MIL_1", ReflectUtilDescriptor.getSignature(methodName, argDescriptors, args), target); throw new WireException(message); } ReflectUtil.invoke(method, target, args); } catch (WireException e) { throw e; } catch (Exception e) { String message = ExceptionManager.getInstance().getFullMessage( "bp_MIL_2", methodName, e.getMessage()); throw new WireException(message, e); } } }
public void apply(Object target, WireContext wireContext) { try { Object[] args = ObjectDescriptor.getArgs(wireContext, argDescriptors); Class<?> clazz = target.getClass(); Method method = ReflectUtilDescriptor.findMethod(clazz, methodName, argDescriptors, args); if (method == null) { String message = ExceptionManager.getInstance().getFullMessage( "bp_IO_1", ReflectUtilDescriptor.getSignature(methodName, argDescriptors, args)); throw new WireException(message); } ReflectUtil.invoke(method, target, args); } catch (WireException e) { throw e; } catch (Exception e) { String message = ExceptionManager.getInstance().getFullMessage( "bp_IO_2", methodName, e.getMessage()); throw new WireException(message, e); } }
throw new WireException(message); object = ReflectUtil.invoke(method, object, args);