public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { if (base instanceof DynamicPropertied) { //don't get value before check it types, , to prevent call super //BeanELResolver too early before other resolvers try { super.setValue(context, base, property, value); } catch (PropertyNotFoundException x) { context.setPropertyResolved(true); ((DynamicPropertied) base).setDynamicProperty(property.toString(), value); } } }
/** Assigns a property. * * <p>Don't use the reflection directly since this method searches * more signatures. * * @exception PropertyNotFoundException if the property is not found, * i.e., no corresponding method and {@link DynamicPropertied} not * implemented. * @exception UiException if fail to assign * @since 3.5.0 */ public static final void assign(Component comp, String name, String value) { final Method mtd = resolveMethod(comp.getClass(), name); if (mtd != null) { try { Object val = Classes.coerce(mtd.getParameterTypes()[0], value); mtd.invoke(comp, val); } catch (Exception ex) { log.error("Failed to assign " + value + " to " + comp + "\n" + Exceptions.getMessage(ex)); throw UiException.Aide.wrap(ex); } } else { ((DynamicPropertied) comp).setDynamicProperty(name, value); } }
((DynamicPropertied)target).setDynamicProperty(attnm, value); else Fields.setByCompound(target, attnm, value, true); ((DynamicPropertied)target).setDynamicProperty(attnm, value); else Fields.setByCompound(target, attnm, value, true);
public void setValue(XelContext ctx, Object value) throws XelException { try { if (cmp instanceof ComponentCtrl) { PropertyAccess propertyAccess = ((ComponentCtrl) cmp).getPropertyAccess(field); if (propertyAccess != null) { try { propertyAccess.setValue(cmp, Classes.coerce(propertyAccess.getType(), value)); return; // done } catch (ClassCastException cce) { // yes, ignore it here and use the old EL way. } } } Fields.set(cmp, field, value, true); } catch (NoSuchMethodException e) { if (cmp instanceof DynamicPropertied) { ((DynamicPropertied) cmp).setDynamicProperty(field, value); } } }
if (dpcomp.hasDynamicProperty(_attr)) { dpcomp.setDynamicProperty(_attr, bean); } else { throw UiException.Aide.wrap(ex);
} else if (mtds == null) { ((DynamicPropertied) comp).setDynamicProperty(_name, val); return; //done } else { //mtds != null && val != null