@Override public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null) { context.setPropertyResolved(true); throw new PropertyNotWritableException( "Legacy VariableResolver wrapped, not writable"); } if (!context.isPropertyResolved()) { elResolver.setValue(context, base, property, value); } }
@Override public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null) { context.setPropertyResolved(true); if (property != null) { String key = property.toString(); PageContext page = (PageContext) context .getContext(JspContext.class); int scope = page.getAttributesScope(key); if (scope != 0) { page.setAttribute(key, value, scope); } else { page.setAttribute(key, value); } } } }
@Override public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null && property != null) { int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString()); if (idx >= 0) { context.setPropertyResolved(true); throw new PropertyNotWritableException(); } } }
@Override public void setValue(ELContext context, Object value) { Object items = _itemsExpression.getValue(context); if (items != null) { if (items instanceof CollectionModel) { // There is no support for setting row data on the collection model throw new PropertyNotWritableException(); } context.setPropertyResolved(false); context.getELResolver().setValue(context, items, _key, value); } }
@Override public void setValue(ELContext eLContext, Object base, Object property, Object value) { if (base == null) { throw new PropertyNotWritableException(); } else { if (_isIndexed(base)) _pr.setValue(base, _getIndex(property), value); else _pr.setValue(base, property, value); } }
@Override public void setValue(ELContext elContext, Object base, Object property, Object value) throws ELException { if (base == null) { String beanName = property.toString(); BeanFactory bf = getBeanFactory(elContext); if (bf.containsBean(beanName)) { if (value == bf.getBean(beanName)) { // Setting the bean reference to the same value is alright - can simply be ignored... elContext.setPropertyResolved(true); } else { throw new PropertyNotWritableException( "Variable '" + beanName + "' refers to a Spring bean which by definition is not writable"); } } } }
public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null) { context.setPropertyResolved(true); throw new PropertyNotWritableException( "Legacy VariableResolver wrapped, not writable"); } if (!context.isPropertyResolved()) { getDefaultResolver().setValue(context, base, property, value); } }
@Override public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null) { context.setPropertyResolved(true); throw new PropertyNotWritableException("Legacy VariableResolver wrapped, not writable"); } if (!context.isPropertyResolved()) { elResolver.setValue(context, base, property, value); } }
@Override public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null) { context.setPropertyResolved(true); if (property != null) { String key = property.toString(); PageContext page = (PageContext) context.getContext(JspContext.class); int scope = page.getAttributesScope(key); if (scope != 0) { page.setAttribute(key, value, scope); } else { page.setAttribute(key, value); } } } }
@Override public void setValue(ELContext elContext, Object base, Object property, Object value) throws ELException { if (base == null) { String beanName = property.toString(); if (beanName.equals(MESSAGESOURCE_SHORTCUT)) beanName = "messageSource"; BeanFactory bf = getBeanFactory(elContext); if (bf.containsBean(beanName)) { throw new PropertyNotWritableException( "Variable '" + beanName + "' refers to a Spring bean which by definition is not writable"); } } else if (base instanceof MessageSource && property != null) { throw new PropertyNotWritableException( "MessageSource: '" + property + "' refers to a Spring bean which by definition is not writable"); } }
@Override public void setValue(ELContext context, Object value) throws PropertyNotFoundException, PropertyNotWritableException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); this.getNode().setValue(ctx, value); }
public void setValue(ELContext context, Object value) throws PropertyNotFoundException, PropertyNotWritableException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); this.getNode().setValue(ctx, value); }
@Override public void setValue(ELContext context, Object base, Object property, Object value) { if (context == null) { throw new NullPointerException("context is null"); } if (isResolvable(base)) { throw new PropertyNotWritableException("resolver is read-only"); } }
@Override public void setValue(ELContext context, Object base, Object property, Object value) { if (context == null) { throw new NullPointerException(); } if (base == null && property != null) { int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString()); if (idx >= 0) { context.setPropertyResolved(base, property); throw new PropertyNotWritableException(); } } }
@Override public void setValue(final ELContext context, final Object base, final Object property, final Object val) { if (context == null) { throw new NullPointerException(); } if ((property != null) && resolveType(base)) { context.setPropertyResolved(base, property); if (isReadOnly(context, base, property)) { throw new PropertyNotWritableException(); } if (val == null) { throw new IllegalArgumentException(String.format("property %s cannot be set to null", property)); } try { final Message.Builder builder = (Message.Builder) base; final FieldDescriptor field = getPropertyFieldDescriptor(builder, property); builder.setField(field, verifyAndConvertField(val, field)); } catch (final UnsupportedOperationException ex) { throw new PropertyNotWritableException(); } } }