Java Code Examples for javax.el.CompositeELResolver#add()
The following examples show how to use
javax.el.CompositeELResolver#add() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SpringExpressionManager.java From activiti6-boot2 with Apache License 2.0 | 6 votes |
@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; }
Example 2
Source File: ExpressionManager.java From activiti6-boot2 with Apache License 2.0 | 6 votes |
protected ELResolver createElResolver(Map<String, Object> variables) { CompositeELResolver elResolver = new CompositeELResolver(); elResolver.add(new VariableElResolver(variables)); if (beans != null) { // ACT-1102: Also expose all beans in configuration when using // standalone activiti, not // in spring-context elResolver.add(new ReadOnlyMapELResolver(beans)); } elResolver.add(new ArrayELResolver()); elResolver.add(new ListELResolver()); elResolver.add(new MapELResolver()); elResolver.add(new JsonNodeELResolver()); elResolver.add(new BeanELResolver()); return elResolver; }
Example 3
Source File: ExpressionManager.java From activiti6-boot2 with Apache License 2.0 | 6 votes |
protected ELResolver createElResolver(VariableScope variableScope) { CompositeELResolver elResolver = new CompositeELResolver(); elResolver.add(new VariableScopeElResolver(variableScope)); if (beans != null) { // ACT-1102: Also expose all beans in configuration when using // standalone activiti, not // in spring-context elResolver.add(new ReadOnlyMapELResolver(beans)); } elResolver.add(new ArrayELResolver()); elResolver.add(new ListELResolver()); elResolver.add(new MapELResolver()); elResolver.add(new JsonNodeELResolver()); elResolver.add(new DynamicBeanPropertyELResolver(ItemInstance.class, "getFieldValue", "setFieldValue")); // TODO: needs verification elResolver.add(new BeanELResolver()); return elResolver; }
Example 4
Source File: JuelElProvider.java From camunda-bpm-platform with Apache License 2.0 | 5 votes |
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; }
Example 5
Source File: ELContextImpl.java From Tomcat8-Source-Read with MIT License | 5 votes |
public static ELResolver getDefaultResolver(ExpressionFactory factory) { if (Constants.IS_SECURITY_ENABLED) { CompositeELResolver defaultResolver = new CompositeELResolver(); defaultResolver.add(factory.getStreamELResolver()); defaultResolver.add(new StaticFieldELResolver()); defaultResolver.add(new MapELResolver()); defaultResolver.add(new ResourceBundleELResolver()); defaultResolver.add(new ListELResolver()); defaultResolver.add(new ArrayELResolver()); defaultResolver.add(new BeanELResolver()); return defaultResolver; } else { return DefaultResolver; } }
Example 6
Source File: ElMetricName.java From metrics-cdi with Apache License 2.0 | 5 votes |
ElMetricName(ELResolver resolver, ExpressionFactory expressionFactory, MetricsExtension extension) { super(extension); CompositeELResolver composite = new CompositeELResolver(); composite.add(resolver); composite.add(new MapELResolver()); composite.add(new ListELResolver()); composite.add(new ArrayELResolver()); composite.add(new ResourceBundleELResolver()); composite.add(new BeanELResolver(true)); this.elResolver = composite; this.expressionFactory = expressionFactory; }
Example 7
Source File: RuleEvaluator.java From proctor with Apache License 2.0 | 5 votes |
@Nonnull private static CompositeELResolver constructStandardElResolver() { final CompositeELResolver elResolver = new CompositeELResolver(); elResolver.add(new ArrayELResolver()); elResolver.add(new ListELResolver()); elResolver.add(new MapELResolver()); elResolver.add(new BeanELResolver()); // this must be last, because it throws Exception return elResolver; }
Example 8
Source File: JuelElProvider.java From camunda-engine-dmn with Apache License 2.0 | 5 votes |
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; }
Example 9
Source File: PageContextImpl.java From packagedrone with Eclipse Public License 1.0 | 5 votes |
private ELResolver getELResolver() { if (elResolver == null) { // Create a CompositeELResolver CompositeELResolver celResolver = new CompositeELResolver(); celResolver.add(new ImplicitObjectELResolver()); // Add ELResolvers registered in JspApplicationContext JspApplicationContextImpl jaContext = getJspApplicationContext(); Iterator<ELResolver> it = jaContext.getELResolvers(); while (it.hasNext()) { celResolver.add(it.next()); } ELResolver streamELResolver = getExpressionFactory(this).getStreamELResolver(); if (streamELResolver != null) { celResolver.add(streamELResolver); } celResolver.add(new StaticFieldELResolver()); celResolver.add(new MapELResolver()); celResolver.add(new ResourceBundleELResolver()); celResolver.add(new ListELResolver()); celResolver.add(new ArrayELResolver()); celResolver.add(new BeanELResolver()); celResolver.add(new ScopedAttributeELResolver()); elResolver = celResolver; } return elResolver; }
Example 10
Source File: ELContextImpl.java From tomcatsrc with Apache License 2.0 | 5 votes |
public static ELResolver getDefaultResolver() { if (Constants.IS_SECURITY_ENABLED) { CompositeELResolver defaultResolver = new CompositeELResolver(); defaultResolver.add(new MapELResolver()); defaultResolver.add(new ResourceBundleELResolver()); defaultResolver.add(new ListELResolver()); defaultResolver.add(new ArrayELResolver()); defaultResolver.add(new BeanELResolver()); return defaultResolver; } else { return DefaultResolver; } }
Example 11
Source File: ELContextImpl.java From Tomcat7.0.67 with Apache License 2.0 | 5 votes |
public static ELResolver getDefaultResolver() { if (Constants.IS_SECURITY_ENABLED) { CompositeELResolver defaultResolver = new CompositeELResolver(); defaultResolver.add(new MapELResolver()); defaultResolver.add(new ResourceBundleELResolver()); defaultResolver.add(new ListELResolver()); defaultResolver.add(new ArrayELResolver()); defaultResolver.add(new BeanELResolver()); return defaultResolver; } else { return DefaultResolver; } }
Example 12
Source File: ProcessEngineFactoryWithELResolver.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
@Override protected ELResolver createElResolver(VariableScope variableScope) { CompositeELResolver compositeElResolver = new CompositeELResolver(); compositeElResolver.add(new VariableScopeElResolver(variableScope)); if (blueprintContextELResolver != null) { compositeElResolver.add(blueprintContextELResolver); } compositeElResolver.add(blueprintELResolver); compositeElResolver.add(new BeanELResolver()); compositeElResolver.add(new ArrayELResolver()); compositeElResolver.add(new ListELResolver()); compositeElResolver.add(new MapELResolver()); return compositeElResolver; }
Example 13
Source File: SimulationExpressionManager.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
@Override protected ELResolver createElResolver(VariableScope variableScope) { CompositeELResolver compositeElResolver = new CompositeELResolver(); compositeElResolver.add(new SimulationScopeElResolver(variableScope)); compositeElResolver.add(super.createElResolver(variableScope)); return compositeElResolver; }
Example 14
Source File: CdiExpressionManager.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
@Override protected ELResolver createElResolver(VariableScope variableScope) { CompositeELResolver compositeElResolver = new CompositeELResolver(); compositeElResolver.add(new VariableScopeElResolver(variableScope)); compositeElResolver.add(new CdiResolver()); compositeElResolver.add(new ArrayELResolver()); compositeElResolver.add(new ListELResolver()); compositeElResolver.add(new MapELResolver()); compositeElResolver.add(new BeanELResolver()); return compositeElResolver; }
Example 15
Source File: MockExpressionManager.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
@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; }
Example 16
Source File: JuelScriptEngine.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
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); }
Example 17
Source File: BenchmarkEl.java From proctor with Apache License 2.0 | 4 votes |
public static void main(final String[] args) { final FunctionMapper functionMapper = new LibraryFunctionMapperBuilder().add("proctor", ProctorRuleFunctions.class).build(); final ExpressionFactory expressionFactory = new ExpressionFactoryImpl(); final CompositeELResolver elResolver = new CompositeELResolver(); elResolver.add(new ArrayELResolver()); elResolver.add(new ListELResolver()); elResolver.add(new BeanELResolver()); elResolver.add(new MapELResolver()); final Map<String, Object> values = Maps.newLinkedHashMap(); values.put("countries", Sets.newHashSet("AA", "BB", "CC", "DD", "EE", "FF", "GG", "HH", "II", "JJ", "KK", "LL", "MM")); values.put("AA", "AA"); values.put("CC", "CC"); values.put("NN", "NN"); values.put("ZZ", "ZZ"); values.put("I1", 239235); values.put("I2", 569071142); values.put("I3", -189245); values.put("D1", 129835.12512); values.put("D2", -9582.9385); values.put("D3", 98982223.598731412); values.put("BT", Boolean.TRUE); values.put("BF", Boolean.FALSE); values.put("GLOOP", ""); final String[] expressions = { "${proctor:contains(countries, AA) || proctor:contains(countries, CC) || D2 < I3 && BF}", "${! proctor:contains(countries, ZZ) && I1 < I2 && empty GLOOP}", "${I2 - I3 + D3 - D1}", "${NN == '0' && ZZ == 'ZZ'}", "${BT != BF}", }; final int iterations = 100*1000; long elapsed = -System.currentTimeMillis(); for (int i = 0; i < iterations; i++) { final Map<String, ValueExpression> localContext = ProctorUtils.convertToValueExpressionMap(expressionFactory, values); final VariableMapper variableMapper = new MulticontextReadOnlyVariableMapper(localContext); final ELContext elContext = new ELContext() { @Override public ELResolver getELResolver() { return elResolver; } @Override public FunctionMapper getFunctionMapper() { return functionMapper; } @Override public VariableMapper getVariableMapper() { return variableMapper; } }; for (int j = 0; j < expressions.length; j++) { final ValueExpression ve = expressionFactory.createValueExpression(elContext, expressions[j], Object.class); final Object result = ve.getValue(elContext); if (i % 10000 == 0) { System.out.println(result); } } } elapsed += System.currentTimeMillis(); final int total = iterations * expressions.length; System.out.println(total + " expressions in " + elapsed + " ms (average " + (elapsed/(((double) total))) + " ms/expression)"); }