public void setIndexedValue(int index, E val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canIndexedWrite()) { throw new IllegalAccessException(); } Object validInstance = Beans.getInstanceOf(instance, indexedSetter.getDeclaringClass()); indexedSetter.invoke(validInstance, new Object[] { new Integer(index), val }); } }
public void setValue(T val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (setter == null) { throw new IllegalAccessException(); } Object valideInstance = Beans.getInstanceOf(instance, setter.getDeclaringClass()); try { setter.invoke(valideInstance, val); } catch (IllegalAccessException ex) { try { setter.setAccessible(true); setter.invoke(valideInstance, val); } finally { setter.setAccessible(false); } } }
public void setValue(T val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canWrite()) { throw new IllegalAccessException(); } Object validInstance = Beans.getInstanceOf(instance, setter.getDeclaringClass()); Object value = val; if ( (val != null) && (setter.getParameterTypes()[0].getComponentType().isPrimitive()) && (!val.getClass().getComponentType().isPrimitive()) ) { value = Utilities.toPrimitiveArray((Object[]) val); } setter.invoke(validInstance, value); }
/** Detaches all listeners from the bean and destroys it. * @throws IOException if there was a problem */ @Override public void destroy() throws IOException { if (removePCLMethod != null) { try { Object o = Beans.getInstanceOf(bean, removePCLMethod.getDeclaringClass()); removePCLMethod.invoke(o, new Object[] { propertyChangeListener }); } catch (Exception e) { NodeOp.exception(e); } } super.destroy(); }
public E getIndexedValue(int index) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canIndexedRead()) { throw new IllegalAccessException(); } Object validInstance = Beans.getInstanceOf(instance, indexedGetter.getDeclaringClass()); return PropertySupport.cast(getElementType(), indexedGetter.invoke(validInstance, index)); }
public T getValue() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canRead()) { throw new IllegalAccessException(); } Object validInstance = Beans.getInstanceOf(instance, getter.getDeclaringClass()); return PropertySupport.cast(getValueType(), getter.invoke(validInstance)); }
public T getValue() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (getter == null) { throw new IllegalAccessException(); } Object valideInstance = Beans.getInstanceOf(instance, getter.getDeclaringClass()); try { try { return cast(getValueType(), getter.invoke(valideInstance)); } catch (IllegalAccessException ex) { try { getter.setAccessible(true); return cast(getValueType(), getter.invoke(valideInstance)); } finally { getter.setAccessible(false); } } } catch (IllegalArgumentException iae) { //Provide a better message for debugging StringBuffer sb = new StringBuffer("Attempted to invoke method "); sb.append(getter.getName()); sb.append(" from class "); sb.append(getter.getDeclaringClass().getName()); sb.append(" on an instance of "); sb.append(valideInstance.getClass().getName()); sb.append(" Problem:"); sb.append(iae.getMessage()); throw (IllegalArgumentException) new IllegalArgumentException(sb.toString()).initCause(iae); } }
Object o = Beans.getInstanceOf(bean, method.getDeclaringClass()); propertyChangeListener = new PropL(); method.invoke(o, new Object[] { WeakListeners.propertyChange(propertyChangeListener, o) });
public void setValue (Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (setter == null) throw new IllegalAccessException (); Object valideInstance = Beans.getInstanceOf (instance, setter.getDeclaringClass()); try { setter.invoke (valideInstance, new Object [] {val}); } catch (IllegalAccessException ex) { try { setter.setAccessible(true); setter.invoke (valideInstance, new Object [] {val}); } finally { setter.setAccessible(false); } } }
public void setIndexedValue (int index, Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canIndexedWrite ()) throw new IllegalAccessException (); Object validInstance = Beans.getInstanceOf (instance, indexedSetter.getDeclaringClass()); indexedSetter.invoke (validInstance, new Object [] {new Integer (index), val}); } }
public void setValue (Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (setter == null) throw new IllegalAccessException (); Object valideInstance = Beans.getInstanceOf (instance, setter.getDeclaringClass()); try { setter.invoke (valideInstance, new Object [] {val}); } catch (IllegalAccessException ex) { try { setter.setAccessible(true); setter.invoke (valideInstance, new Object [] {val}); } finally { setter.setAccessible(false); } } }
public Object getIndexedValue (int index) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canIndexedRead ()) throw new IllegalAccessException (); Object validInstance = Beans.getInstanceOf (instance, indexedGetter.getDeclaringClass()); return indexedGetter.invoke (validInstance, new Object [] {new Integer (index)}); }
public Object getValue () throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canRead ()) throw new IllegalAccessException (); Object validInstance = Beans.getInstanceOf (instance, getter.getDeclaringClass()); return getter.invoke (validInstance, new Object [0]); }
public void setIndexedValue (int index, Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canIndexedWrite ()) throw new IllegalAccessException (); Object validInstance = Beans.getInstanceOf (instance, indexedSetter.getDeclaringClass()); indexedSetter.invoke (validInstance, new Object [] {new Integer (index), val}); } }
public Object getIndexedValue (int index) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canIndexedRead ()) throw new IllegalAccessException (); Object validInstance = Beans.getInstanceOf (instance, indexedGetter.getDeclaringClass()); return indexedGetter.invoke (validInstance, new Object [] {new Integer (index)}); }
public Object getValue () throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canRead ()) throw new IllegalAccessException (); Object validInstance = Beans.getInstanceOf (instance, getter.getDeclaringClass()); return getter.invoke (validInstance, new Object [0]); }
public void setValue (Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canWrite ()) throw new IllegalAccessException (); Object validInstance = Beans.getInstanceOf (instance, setter.getDeclaringClass()); if ((val!=null)&&(setter.getParameterTypes()[0].getComponentType().isPrimitive())&&(!val.getClass().getComponentType().isPrimitive())) { val = Utilities.toPrimitiveArray ((Object[])val); } setter.invoke (validInstance, new Object [] {val}); }
public void setValue (Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (!canWrite ()) throw new IllegalAccessException (); Object validInstance = Beans.getInstanceOf (instance, setter.getDeclaringClass()); if ((val!=null)&&(setter.getParameterTypes()[0].getComponentType().isPrimitive())&&(!val.getClass().getComponentType().isPrimitive())) { val = Utilities.toPrimitiveArray ((Object[])val); } setter.invoke (validInstance, new Object [] {val}); }
/** Detaches all listeners from the bean and destroys it. * @throws IOException if there was a problem */ public void destroy () throws IOException { if (removePCLMethod != null) { try { Object o = Beans.getInstanceOf (bean, removePCLMethod.getDeclaringClass ()); removePCLMethod.invoke (o, new Object[] {propertyChangeListener}); } catch (Exception e) { NodeOp.exception (e); } } super.destroy (); }
/** Detaches all listeners from the bean and destroys it. * @throws IOException if there was a problem */ public void destroy () throws IOException { if (removePCLMethod != null) { try { Object o = Beans.getInstanceOf (bean, removePCLMethod.getDeclaringClass ()); removePCLMethod.invoke (o, new Object[] {propertyChangeListener}); } catch (Exception e) { NodeOp.exception (e); } } super.destroy (); }