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); }
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 ResourceBundle) { context.setPropertyResolved(true); throw new PropertyNotWritableException(message(context, "resolverNotWriteable", new Object[] { base.getClass() .getName() })); } }
/** * If the base object is a ResourceBundle, returns the most general type that this resolver * accepts for the property argument. Otherwise, returns null. Assuming the base is a * ResourceBundle, this method will always return String.class. * * @param context * The context of this evaluation. * @param base * The bundle to analyze. Only bases of type ResourceBundle are handled by this * resolver. * @return null if base is not a ResourceBundle; otherwise String.class. */ @Override public Class<?> getCommonPropertyType(ELContext context, Object base) { return isResolvable(base) ? String.class : 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 ResourceBundle) { context.setPropertyResolved(true); throw new PropertyNotWritableException(message(context, "resolverNotWriteable", new Object[] { base.getClass() .getName() })); } }
/** * If the base object is a ResourceBundle, returns the most general type that this resolver * accepts for the property argument. Otherwise, returns null. Assuming the base is a * ResourceBundle, this method will always return String.class. * * @param context * The context of this evaluation. * @param base * The bundle to analyze. Only bases of type ResourceBundle are handled by this * resolver. * @return null if base is not a ResourceBundle; otherwise String.class. */ @Override public Class<?> getCommonPropertyType(ELContext context, Object base) { return isResolvable(base) ? String.class : null; }
public ELResolver getELResolver() { if (elResolver == null) { CompositeELResolver resolver = new CompositeELResolver(); resolver.add(new BeanNameELResolver(new LocalBeanNameResolver())); customResolvers = new CompositeELResolver(); resolver.add(customResolvers); if (streamELResolver != null) { resolver.add(new StaticFieldELResolver()); resolver.add(new MapELResolver()); resolver.add(new ResourceBundleELResolver()); resolver.add(new ListELResolver()); resolver.add(new ArrayELResolver()); resolver.add(new BeanELResolver()); elResolver = resolver;
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 ResourceBundle) { context.setPropertyResolved(true); throw new PropertyNotWritableException(message(context, "resolverNotWriteable", new Object[] { base.getClass() .getName() })); } }
/** * If the base object is a ResourceBundle, returns the most general type that this resolver * accepts for the property argument. Otherwise, returns null. Assuming the base is a * ResourceBundle, this method will always return String.class. * * @param context * The context of this evaluation. * @param base * The bundle to analyze. Only bases of type ResourceBundle are handled by this * resolver. * @return null if base is not a ResourceBundle; otherwise String.class. */ @Override public Class<?> getCommonPropertyType(ELContext context, Object base) { return isResolvable(base) ? String.class : null; }
public CompositeELResolverImpl() { add(new ScopeELResolver()); add(new TilesContextELResolver(new TilesContextBeanELResolver())); add(new TilesContextBeanELResolver()); add(new ArrayELResolver(false)); add(new ListELResolver(false)); add(new MapELResolver(false)); add(new ResourceBundleELResolver()); add(new BeanELResolver(false)); } }
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 ResourceBundle) { context.setPropertyResolved(true); throw new PropertyNotWritableException(message(context, "resolverNotWriteable", new Object[] { base.getClass() .getName() })); } }
/** * If the base object is not null and an instanceof java.util.ResourceBundle, return true. * * @return If the propertyResolved property of ELContext was set to true, then true; otherwise * undefined. * @throws NullPointerException * if context is null. */ @Override public boolean isReadOnly(ELContext context, Object base, Object property) { if (context == null) { throw new NullPointerException("context is null"); } if (isResolvable(base)) { context.setPropertyResolved(true); } return true; }
public DefaultELEngine(ExpressionFactory expressionFactory) { ELResolver resolver = new CompositeELResolver() { { add(new ArrayELResolver()); add(new ListELResolver()); add(new MapELResolver()); add(new BeanELResolver()); add(new ResourceBundleELResolver()); } }; this.elContext = new SimpleELContext(resolver); this.expressionFactory = expressionFactory; }
@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 instanceof ResourceBundle) { context.setPropertyResolved(true); throw new PropertyNotWritableException(message(context, "resolverNotWriteable", new Object[] { base.getClass() .getName() })); } }
/** * If the base object is not null and an instanceof java.util.ResourceBundle, return true. * * @return If the propertyResolved property of ELContext was set to true, then true; otherwise * undefined. * @throws NullPointerException * if context is null. */ @Override public boolean isReadOnly(ELContext context, Object base, Object property) { if (context == null) { throw new NullPointerException("context is null"); } if (isResolvable(base)) { context.setPropertyResolved(true); } return true; }
public CompositeELResolverImpl() { add(new ScopeELResolver()); add(new TilesContextELResolver(new TilesContextBeanELResolver())); add(new TilesContextBeanELResolver()); add(new ArrayELResolver(false)); add(new ListELResolver(false)); add(new MapELResolver(false)); add(new ResourceBundleELResolver()); add(new BeanELResolver(false)); } }
/** * If the base object is not null and an instanceof java.util.ResourceBundle, return true. * * @return If the propertyResolved property of ELContext was set to true, then true; otherwise * undefined. * @throws NullPointerException * if context is null. */ @Override public boolean isReadOnly(ELContext context, Object base, Object property) { if (context == null) { throw new NullPointerException("context is null"); } if (isResolvable(base)) { context.setPropertyResolved(true); } return true; }
protected static ELResolver createDefaultResolver() { CompositeELResolver resolver = new CompositeELResolver(); resolver.add(new VariableContextElResolver()); resolver.add(new ArrayELResolver(true)); resolver.add(new ListELResolver(true)); resolver.add(new MapELResolver(true)); resolver.add(new ResourceBundleELResolver()); resolver.add(new BeanELResolver()); return resolver; } }
/** * If the base object is an instance of ResourceBundle, return null, since the resolver is read * only. If the base is ResourceBundle, the propertyResolved property of the ELContext object * must be set to true by this resolver, before returning. If this property is not true after * this method is called, the caller should ignore the return value. * * @param context * The context of this evaluation. * @param base * The bundle to analyze. Only bases of type ResourceBundle are handled by this * resolver. * @param property * The name of the property to analyze. * @return If the propertyResolved property of ELContext was set to true, then null; otherwise * undefined. * @throws NullPointerException * if context is null */ @Override public Class<?> getType(ELContext context, Object base, Object property) { if (context == null) { throw new NullPointerException("context is null"); } if (isResolvable(base)) { context.setPropertyResolved(true); } return null; }
private static ELResolver createELResolver(Object base) { CompositeELResolver resolver = new CompositeELResolver(); if (base != null) { resolver.add(new BaseELResolver(base)); } resolver.add(new MapELResolver()); resolver.add(new ListELResolver()); resolver.add(new ArrayELResolver()); resolver.add(new ResourceBundleELResolver()); resolver.add(new BeanELResolver()); return resolver; }
/** * If the base object is an instance of ResourceBundle, return null, since the resolver is read * only. If the base is ResourceBundle, the propertyResolved property of the ELContext object * must be set to true by this resolver, before returning. If this property is not true after * this method is called, the caller should ignore the return value. * * @param context * The context of this evaluation. * @param base * The bundle to analyze. Only bases of type ResourceBundle are handled by this * resolver. * @param property * The name of the property to analyze. * @return If the propertyResolved property of ELContext was set to true, then null; otherwise * undefined. * @throws NullPointerException * if context is null */ @Override public Class<?> getType(ELContext context, Object base, Object property) { if (context == null) { throw new NullPointerException("context is null"); } if (isResolvable(base)) { context.setPropertyResolved(true); } return null; }