/** * Calls {@link ExpressionFactory#newInstance()} directly without any classpath checking * * @return {@link ExpressionFactory} instance */ public static ExpressionFactory newInstance() { return ExpressionFactory.newInstance(); } }
/** * Creates a new instance of a <code>ExpressionFactory</code>. * This method uses the following ordered lookup procedure to determine * the <code>ExpressionFactory</code> implementation class to load: * <ul> * <li>Use the Services API (as detailed in the JAR specification). * If a resource with the name of * <code>META-INF/services/javax.el.ExpressionFactory</code> exists, * then its first line, if present, is used as the UTF-8 encoded name of * the implementation class. </li> * <li>Use the properties file "lib/el.properties" in the JRE directory. * If this file exists and it is readable by the * <code> java.util.Properties.load(InputStream)</code> method, * and it contains an entry whose key is "javax.el.ExpressionFactory", * then the value of that entry is used as the name of the * implementation class.</li> * <li>Use the <code>javax.el.ExpressionFactory</code> system property. * If a system property with this name is defined, then its value is * used as the name of the implementation class.</li> * <li>Use a platform default implementation.</li> * </ul> */ public static ExpressionFactory newInstance() { return ExpressionFactory.newInstance(null); }
@Override public JavaxElPolicyExecutor build() { if (null == expressionFactory) { try { expressionFactory = ExpressionFactory.newInstance(); } catch (ELException e) { LOGGER.fine( "Expression language factory not available. To support policy expressions, you need to add some " + "implementation to class/module path"); } } return new JavaxElPolicyExecutor(this); }
public static Object makeExpressionPayload ( String expr ) throws IllegalArgumentException, IllegalAccessException, Exception { FacesContextImpl fc = new FacesContextImpl((ServletContext) null, (ServletRequest) null, (ServletResponse) null); ELContext elContext = new FacesELContext(new CompositeELResolver(), fc); Reflections.getField(FacesContextImplBase.class, "_elContext").set(fc, elContext); ExpressionFactory expressionFactory = ExpressionFactory.newInstance(); ValueExpression ve1 = expressionFactory.createValueExpression(elContext, expr, Object.class); ValueExpressionMethodExpression e = new ValueExpressionMethodExpression(ve1); ValueExpression ve2 = expressionFactory.createValueExpression(elContext, "${true}", Object.class); ValueExpressionMethodExpression e2 = new ValueExpressionMethodExpression(ve2); return Gadgets.makeMap(e2, e); }
/** * Creates a new instance of a <code>ExpressionFactory</code>. * This method uses the following ordered lookup procedure to determine * the <code>ExpressionFactory</code> implementation class to load: * <ul> * <li>Use the Services API (as detailed in the JAR specification). * If a resource with the name of * <code>META-INF/services/javax.el.ExpressionFactory</code> exists, * then its first line, if present, is used as the UTF-8 encoded name of * the implementation class. </li> * <li>Use the properties file "lib/el.properties" in the JRE directory. * If this file exists and it is readable by the * <code> java.util.Properties.load(InputStream)</code> method, * and it contains an entry whose key is "javax.el.ExpressionFactory", * then the value of that entry is used as the name of the * implementation class.</li> * <li>Use the <code>javax.el.ExpressionFactory</code> system property. * If a system property with this name is defined, then its value is * used as the name of the implementation class.</li> * <li>Use a platform default implementation.</li> * </ul> */ public static ExpressionFactory newInstance() { return ExpressionFactory.newInstance(null); }
private Object invokeMethod(Method m, Object base, Object[] params) { Class[] parameterTypes = m.getParameterTypes(); Object[] parameters = null; if (parameterTypes.length > 0) { ExpressionFactory exprFactory = ExpressionFactory.newInstance(); if (m.isVarArgs()) { // TODO } else { parameters = new Object[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; i++) { parameters[i] = exprFactory.coerceToType(params[i], parameterTypes[i]); } } } try { return m.invoke(base, parameters); } catch (IllegalAccessException iae) { throw new ELException(iae); } catch (InvocationTargetException ite) { throw new ELException(ite.getCause()); } } }
static ExpressionFactory getExpressionFactory() { if (exprFactory == null){ exprFactory = ExpressionFactory.newInstance(properties); } return exprFactory; }
public ExpressionFactory getExpressionFactory() { if (expressionFactory == null) { expressionFactory = ExpressionFactory.newInstance(); } return expressionFactory; }
public ExpressionFactory getExpressionFactory() { if (expressionFactory == null) { expressionFactory = ExpressionFactory.newInstance(); } return expressionFactory; }
private static ExpressionFactory getExpressionFactory() { if (expFactory == null) { expFactory = ExpressionFactory.newInstance(); } return expFactory; }
public ExpressionFactory getExpressionFactory() { if (expressionFactory == null) { expressionFactory = ExpressionFactory.newInstance(); } return expressionFactory; }
private static ExpressionFactory getExpressionFactory() { if (expFactory == null) { expFactory = ExpressionFactory.newInstance(); } return expFactory; }
private static ExpressionFactory getExpressionFactory() { if (expFactory == null) { expFactory = ExpressionFactory.newInstance(); } return expFactory; }
private static ExpressionFactory getExpressionFactory() { if (expFactory == null) { expFactory = ExpressionFactory.newInstance(); } return expFactory; } }
private static ExpressionFactory getExpressionFactory() { if (expFactory == null) { expFactory = ExpressionFactory.newInstance(); } return expFactory; }
public ExpressionFactory getExpressionFactory() { if (expressionFactory == null) { expressionFactory = ExpressionFactory.newInstance(); } return expressionFactory; }
public static ExpressionFactory newExpressionFactory() { // JRF: recommend moving this to an ExpressionFactory implementation of // our own that extends the JUEL ExpressionFactoryImpl // and register only our ExpressionFactory implementation class name in // META-INF/services/javax.el.ExpressionFactory // note: this requires changing the JUEL dependency to prevent it from // registering their ExpressionFactoryImpl in // META-INF/services/javax.el.ExpressionFactory automatically Properties props = new Properties(); props.setProperty("de.odysseus.el.misc.TypeConverter", ByteArrayTypeConverter.class.getName()); return ExpressionFactory.newInstance(props); }
/** * @return Builds a new ExpressionFactory. */ @Produces @Default @SuppressWarnings({ CompilerWarnings.NULL, CompilerWarnings.STATIC_METHOD }) public ExpressionFactory factory() { return ExpressionFactory.newInstance(); }
@Override protected void configure() { bind(ExpressionFactory.class).toInstance(ExpressionFactory.newInstance()); bind(ELService.class).to(ELServiceInternal.class); bind(ELContextBuilder.class).to(ELContextBuilderImpl.class); for (Class<ELHandler> elHandlerClass : elMap.values()) { bind(elHandlerClass); } // bind the map of annotation -> ELHandler bind(MAP_TYPE_LITERAL).toInstance(ImmutableMap.copyOf(elMap)); } }
public ELEngine() { factory = ExpressionFactory.newInstance(); resolver = new CompositeELResolver(); resolver.add(new ArrayELResolver()); resolver.add(new ListELResolver()); resolver.add(new MapELResolver()); resolver.add(new BeanELResolver()); }