public Object getValue(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } Object val = null; if (base instanceof DynamicPropertied) { //don't get value before check it types(DynamicPropertied), to prevent call super //BeanELResolver too early before other resolvers try { val = super.getValue(context, base, property); } catch (PropertyNotFoundException x) { if (((DynamicPropertied) base).hasDynamicProperty(property.toString())) { context.setPropertyResolved(true); val = ((DynamicPropertied) base).getDynamicProperty(property.toString()); } else { context.setPropertyResolved(false); //super always set resolved to true, reset it } } } return val; }
public Object evaluate(XelContext ctx) throws XelException { try { if (cmp instanceof ComponentCtrl) { PropertyAccess propertyAccess = ((ComponentCtrl) cmp).getPropertyAccess(field); if (propertyAccess != null) return propertyAccess.getValue(cmp); } return Fields.get(cmp, field); } catch (NoSuchMethodException e) { if (cmp instanceof DynamicPropertied) { return ((DynamicPropertied) cmp).getDynamicProperty(field); } return null; } }
final DynamicPropertied dpcomp = (DynamicPropertied) comp; if (dpcomp.hasDynamicProperty(_attr)) { rawval = dpcomp.getDynamicProperty(_attr); } else { throw UiException.Aide.wrap(ex);