private ELResolver createElResolver() { CompositeELResolver compositeResolver = new CompositeELResolver(); compositeResolver.add(new ArrayELResolver()); compositeResolver.add(new ListELResolver()); compositeResolver.add(new MapELResolver()); compositeResolver.add(new JsonNodeELResolver()); compositeResolver.add(new ResourceBundleELResolver()); compositeResolver.add(new DynamicBeanPropertyELResolver(ItemInstance.class, "getFieldValue", "setFieldValue")); compositeResolver.add(new BeanELResolver()); return new SimpleResolver(compositeResolver); }
context.setPropertyResolved(true); List list = (List) base; int index = toInteger(property); if (index < 0 || index >= list.size()) { throw new PropertyNotFoundException();
@Override public Class<?> getType(ELContext context, Object base, Object property) { Objects.requireNonNull(context); if (base instanceof List<?>) { context.setPropertyResolved(base, property); List<?> list = (List<?>) base; int idx = coerce(property); if (idx < 0 || idx >= list.size()) { throw new PropertyNotFoundException( new ArrayIndexOutOfBoundsException(idx).getMessage()); } return Object.class; } return null; }
context.setPropertyResolved(base, property); List list = (List) base; int index = toInteger(property); if (index < 0 || index >= list.size()) { return null;
public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { if (context == null) { throw new NullPointerException(); } if (base instanceof List) { context.setPropertyResolved(true); List list = (List) base; if (this.readOnly) { throw new PropertyNotWritableException(message(context, "resolverNotWriteable", new Object[] { base.getClass() .getName() })); } int idx = coerce(property); checkBounds(list, idx); try { list.set(idx, value); } catch (UnsupportedOperationException e) { throw new PropertyNotWritableException(e); } catch (IndexOutOfBoundsException e) { throw new PropertyNotFoundException(e); } } }
@Override public Object getValue(ELContext context, Object base, Object property) { Objects.requireNonNull(context); if (base instanceof List<?>) { context.setPropertyResolved(base, property); List<?> list = (List<?>) base; int idx = coerce(property); if (idx < 0 || idx >= list.size()) { return null; } return list.get(idx); } return null; }
public boolean isReadOnly(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } if (base instanceof List) { context.setPropertyResolved(true); List list = (List) base; int idx = coerce(property); checkBounds(list, idx); return this.readOnly || UNMODIFIABLE.equals(list.getClass()); } return this.readOnly; }
@Override public Class<?> getType(ELContext context, Object base, Object property) { Objects.requireNonNull(context); if (base instanceof List<?>) { context.setPropertyResolved(base, property); List<?> list = (List<?>) base; int idx = coerce(property); if (idx < 0 || idx >= list.size()) { throw new PropertyNotFoundException( new ArrayIndexOutOfBoundsException(idx).getMessage()); } return Object.class; } return null; }
context.setPropertyResolved(true); List list = (List) base; int index = toInteger(property); if (index < 0 || index >= list.size()) { return null;
public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { if (context == null) { throw new NullPointerException(); } if (base instanceof List) { context.setPropertyResolved(true); List list = (List) base; if (this.readOnly) { throw new PropertyNotWritableException(message(context, "resolverNotWriteable", new Object[] { base.getClass() .getName() })); } int idx = coerce(property); checkBounds(list, idx); try { list.set(idx, value); } catch (UnsupportedOperationException e) { throw new PropertyNotWritableException(e); } catch (IndexOutOfBoundsException e) { throw new PropertyNotFoundException(e); } } }
@Override public Object getValue(ELContext context, Object base, Object property) { Objects.requireNonNull(context); if (base instanceof List<?>) { context.setPropertyResolved(base, property); List<?> list = (List<?>) base; int idx = coerce(property); if (idx < 0 || idx >= list.size()) { return null; } return list.get(idx); } return null; }
public boolean isReadOnly(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } if (base instanceof List) { context.setPropertyResolved(true); List list = (List) base; int idx = coerce(property); checkBounds(list, idx); return this.readOnly || UNMODIFIABLE.equals(list.getClass()); } return this.readOnly; }
@Override protected ELResolver createElResolver(VariableScope variableScope) { CompositeELResolver compositeElResolver = new CompositeELResolver(); compositeElResolver.add(new VariableScopeElResolver(variableScope)); compositeElResolver.add(new MockElResolver()); compositeElResolver.add(new ArrayELResolver()); compositeElResolver.add(new ListELResolver()); compositeElResolver.add(new MapELResolver()); compositeElResolver.add(new BeanELResolver()); return compositeElResolver; }
context.setPropertyResolved(true); List list = (List) base; int index = toInteger(property); if (index < 0 || index >= list.size()) { throw new PropertyNotFoundException();
public boolean isReadOnly(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } if (base instanceof List) { context.setPropertyResolved(true); List list = (List) base; int idx = coerce(property); if (idx < 0 || idx >= list.size()) { throw new PropertyNotFoundException( new ArrayIndexOutOfBoundsException(idx).getMessage()); } return this.readOnly || UNMODIFIABLE.equals(list.getClass()); } return this.readOnly; }
context.setPropertyResolved(base, property); List list = (List) base; int index = toInteger(property); if (index < 0 || index >= list.size()) { return null;
public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { if (context == null) { throw new NullPointerException(); } if (base instanceof List) { context.setPropertyResolved(true); List list = (List) base; if (this.readOnly) { throw new PropertyNotWritableException(message(context, "resolverNotWriteable", new Object[] { base.getClass() .getName() })); } int idx = coerce(property); try { list.set(idx, value); } catch (UnsupportedOperationException e) { throw new PropertyNotWritableException(e); } catch (IndexOutOfBoundsException e) { throw new PropertyNotFoundException(e); } } }
public Object getValue(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } if (base instanceof List) { context.setPropertyResolved(true); List list = (List) base; int idx = coerce(property); if (idx < 0 || idx >= list.size()) { return null; } return list.get(idx); } return null; }
public Class<?> getType(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } if (base instanceof List) { context.setPropertyResolved(true); List list = (List) base; int idx = coerce(property); checkBounds(list, idx); Object obj = list.get(idx); return (obj != null) ? obj.getClass() : null; } return null; }
@Override protected ELResolver createElResolver(VariableScope variableScope) { CompositeELResolver compositeElResolver = new CompositeELResolver(); compositeElResolver.add(new VariableScopeElResolver(variableScope)); if (beans != null) { // Only expose limited set of beans in expressions compositeElResolver.add(new ReadOnlyMapELResolver(beans)); } else { // Expose full application-context in expressions compositeElResolver.add(new ApplicationContextElResolver(applicationContext)); } compositeElResolver.add(new ArrayELResolver()); compositeElResolver.add(new ListELResolver()); compositeElResolver.add(new MapELResolver()); compositeElResolver.add(new JsonNodeELResolver()); compositeElResolver.add(new BeanELResolver()); return compositeElResolver; }