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); }
BeanProperty bp = getBeanProperty(context, base, property); context.setPropertyResolved(true); return bp.getPropertyType();
m = c.getMethod(method.getName(), method.getParameterTypes()); c = m.getDeclaringClass(); if ((m = getMethod(c, m)) != null) return m; } catch (NoSuchMethodException ex) { m = c.getMethod(method.getName(), method.getParameterTypes()); c = m.getDeclaringClass(); if ((m = getMethod(c, m)) != null) return m; } catch (NoSuchMethodException ex) {
@Override public Class<?> getType(ELContext context, Object base, Object property) { Objects.requireNonNull(context); if (base == null || property == null) { return null; } context.setPropertyResolved(base, property); return this.property(context, base, property).getPropertyType(); }
public Object getValue(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null || property == null) { return null; } context.setPropertyResolved(true); Method m = this.property(context, base, property).read(context); try { return m.invoke(base, (Object[]) null); } catch (IllegalAccessException e) { throw new ELException(e); } catch (InvocationTargetException e) { throw new ELException(message(context, "propertyReadError", new Object[] { base.getClass().getName(), property.toString() }), e.getCause()); } catch (Exception e) { throw new ELException(e); } }
@Override public ELResolver getELResolver() { CompositeELResolver resolver = new CompositeELResolver(); resolver.add(new ResponseContextResolver(entity, resource, instance)); resolver.add(new BeanELResolver(true)); return resolver; }
m = getMethod(base.getClass(), m); for (Object p: params) { context.setPropertyResolved(base, method); return ret;
public BaseELResolver(final Object base) { this.base = base; this.delegateResolver = new BeanELResolver(true); }
public Class<?> getType(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null || property == null) { return null; } context.setPropertyResolved(true); return this.property(context, base, property).getPropertyType(); }
public Object getValue(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null || property == null) { return null; } context.setPropertyResolved(true); Method m = this.property(context, base, property).read(context); try { return m.invoke(base, (Object[]) null); } catch (IllegalAccessException e) { throw new ELException(e); } catch (InvocationTargetException e) { throw new ELException(message(context, "propertyReadError", new Object[] { base.getClass().getName(), property.toString() }), e.getCause()); } catch (Exception e) { throw new ELException(e); } }
@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); if (isReadOnly) { return true; BeanProperty bp = getBeanProperty(context, base, property); return bp.isReadOnly();
public boolean isReadOnly(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null || property == null) { return false; } context.setPropertyResolved(true); return this.readOnly || this.property(context, base, property).isReadOnly(); }
public Object getValue(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null || property == null) { return null; } context.setPropertyResolved(true); Method m = this.property(context, base, property).read(context); try { return m.invoke(base, (Object[]) null); } catch (IllegalAccessException e) { throw new ELException(e); } catch (InvocationTargetException e) { throw new ELException(message(context, "propertyReadError", new Object[] { base.getClass().getName(), property.toString() }), e.getCause()); } catch (Exception e) { throw new ELException(e); } }
m = c.getMethod(method.getName(), method.getParameterTypes()); c = m.getDeclaringClass(); if ((m = getMethod(c, m)) != null) return m; } catch (NoSuchMethodException ex) { m = c.getMethod(method.getName(), method.getParameterTypes()); c = m.getDeclaringClass(); if ((m = getMethod(c, m)) != null) return m; } catch (NoSuchMethodException ex) {
@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; }
BeanProperty bp = getBeanProperty(context, base, property); Method method = bp.getReadMethod(); if (method == null) { throw new PropertyNotFoundException( try { value = method.invoke(base, new Object[0]); context.setPropertyResolved(base, property); } catch (ELException ex) { throw ex;
public Class<?> getType(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null || property == null) { return null; } context.setPropertyResolved(true); return this.property(context, base, property).getPropertyType(); }
public Object getValue(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); } if (base == null || property == null) { return null; } context.setPropertyResolved(true); Method m = this.property(context, base, property).read(context); try { return m.invoke(base, (Object[]) null); } catch (IllegalAccessException e) { throw new ELException(e); } catch (InvocationTargetException e) { throw new ELException(message(context, "propertyReadError", new Object[] { base.getClass().getName(), property.toString() }), e.getCause()); } catch (Exception e) { throw new ELException(e); } }
static private Method getMethodFromInterfaceOrSuperclass(Class cl, Method method) { if (method == null) { return null; } Class [] interfaces = cl.getInterfaces (); for (int i = 0; i < interfaces.length; i++) { Class c = interfaces[i]; Method m = null; try { m = c.getMethod(method.getName(), method.getParameterTypes()); c = m.getDeclaringClass(); if ((m = getMethod(c, m)) != null) return m; } catch (NoSuchMethodException ex) { } } Class c = cl.getSuperclass(); if (c != null) { Method m = null; try { m = c.getMethod(method.getName(), method.getParameterTypes()); c = m.getDeclaringClass(); if ((m = getMethod(c, m)) != null) return m; } catch (NoSuchMethodException ex) { } } return null; }