Examples of ExpressionFactory


Examples of com.avaje.ebean.ExpressionFactory

  @SuppressWarnings({ "rawtypes", "unchecked" })
  public <T> SpiExpressionList<T> filterMany(Query<T> rootQuery) {
    if (filterMany == null) {
      FilterExprPath exprPath = new FilterExprPath(path);
      SpiExpressionFactory queryEf = (SpiExpressionFactory) rootQuery.getExpressionFactory();
      ExpressionFactory filterEf = queryEf.createExpressionFactory();// exprPath);
      filterMany = new FilterExpressionList(exprPath, filterEf, rootQuery);
      // by default we need to make this a 'query join' now
      queryFetchAll = true;
      queryFetchBatch = 100;
      lazyFetchBatch = 100;
View Full Code Here

Examples of com.exigen.ie.constrainer.ExpressionFactory

  public boolean isLinear(){
    return _exp.isLinear();
  }

  public IntBoolExp toIntBoolExp(){
    ExpressionFactory factory = constrainer().expressionFactory();
    Class clazz = IntBoolExpEqValue.class;
    Object[] args = new Object[]{_exp, new Integer(_value)};
    Class[] types = new Class[]{IntExp.class, int.class};

    return (IntBoolExpEqValue) factory.getExpression(clazz, args, types);
  }
View Full Code Here

Examples of com.volantis.xml.expression.ExpressionFactory

     * of empty strings (one for each match, plus one extra) results.
     */
    public void testStringEqualsMultipleSingleLetterPattern()
            throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"xxxxxxxxxx"});
        Value pattern = factory.createStringValue("x");
        Value retVal = tokenize.invoke(context,
                new Value[]{sequence, pattern});

        final Sequence retSeq = retVal.getSequence();

View Full Code Here

Examples of javax.el.ExpressionFactory

            listeners.addLast(listener);
        }
    }

    private static ExpressionFactory findExpressionFactoryImplementation() {
        ExpressionFactory ef = tryExpressionFactoryImplementation("com.sun");
        if(ef == null) {
            ef = tryExpressionFactoryImplementation("org.apache");
            if(ef == null) {
                logger.warn("Could not find any implementation for " +
                        ExpressionFactory.class.getName());
View Full Code Here

Examples of javax.el.ExpressionFactory

        expect(elContext.getVariableMapper()).andStubReturn(vm);

        bean = new Bean();


        ExpressionFactory expressionFactory = createMock(ExpressionFactory.class);
        JspApplicationContext applicationContext = createMock(JspApplicationContext.class);
        JspFactory jspFactory = createMock(JspFactory.class);
        expect(expressionFactory.coerceToType(VALUE, String.class)).andStubReturn(VALUE);
        expect(expressionFactory.coerceToType(null, String.class)).andStubReturn(null);
        expect(applicationContext.getExpressionFactory()).andStubReturn(expressionFactory);
        expect(jspFactory.getJspApplicationContext(null)).andStubReturn(applicationContext);
        replay(jspFactory, applicationContext, expressionFactory);
        JspFactory.setDefaultFactory(jspFactory);
    }
View Full Code Here

Examples of javax.el.ExpressionFactory

            validateFunctions(el, n);

            // test it out
            ELContextImpl ctx = new ELContextImpl(expressionFactory);
            ctx.setFunctionMapper(this.getFunctionMapper(el));
            ExpressionFactory ef = this.pageInfo.getExpressionFactory();
            try {
                ef.createValueExpression(ctx, expr, Object.class);
            } catch (ELException e) {

            }
        }
View Full Code Here

Examples of javax.el.ExpressionFactory

    public static Object proprietaryEvaluate(final String expression,
            final Class<?> expectedType, final PageContext pageContext,
            final ProtectedFunctionMapper functionMap)
            throws ELException {
        Object retValue;
        final ExpressionFactory exprFactory = jspf.getJspApplicationContext(pageContext.getServletContext()).getExpressionFactory();
        if (SecurityUtil.isPackageProtectionEnabled()) {
            try {
                retValue = AccessController
                        .doPrivileged(new PrivilegedExceptionAction<Object>() {

                            @Override
                            public Object run() throws Exception {
                                ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();
                                ctx.setFunctionMapper(functionMap);
                                ValueExpression ve = exprFactory.createValueExpression(ctx, expression, expectedType);
                                return ve.getValue(ctx);
                            }
                        });
            } catch (PrivilegedActionException ex) {
                Exception realEx = ex.getException();
                if (realEx instanceof ELException) {
                    throw (ELException) realEx;
                } else {
                    throw new ELException(realEx);
                }
            }
        } else {
            ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();
            ctx.setFunctionMapper(functionMap);
            ValueExpression ve = exprFactory.createValueExpression(ctx, expression, expectedType);
            retValue = ve.getValue(ctx);
        }

        return retValue;
    }
View Full Code Here

Examples of javax.el.ExpressionFactory

  public static Object proprietaryEvaluate(final String expression,
      final Class expectedType, final PageContext pageContext,
      final ProtectedFunctionMapper functionMap, final boolean escape)
      throws ELException {
    Object retValue;
        final ExpressionFactory exprFactory = JspFactory.getDefaultFactory().getJspApplicationContext(pageContext.getServletContext()).getExpressionFactory();
    if (SecurityUtil.isPackageProtectionEnabled()) {
      try {
        retValue = AccessController
            .doPrivileged(new PrivilegedExceptionAction() {

              public Object run() throws Exception {
                                ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();
                                ctx.setFunctionMapper(new FunctionMapperImpl(functionMap));
                ValueExpression ve = exprFactory.createValueExpression(ctx, expression, expectedType);
                                return ve.getValue(ctx);
              }
            });
      } catch (PrivilegedActionException ex) {
        Exception realEx = ex.getException();
        if (realEx instanceof ELException) {
          throw (ELException) realEx;
        } else {
          throw new ELException(realEx);
        }
      }
    } else {
            ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();
            ctx.setFunctionMapper(new FunctionMapperImpl(functionMap));
            ValueExpression ve = exprFactory.createValueExpression(ctx, expression, expectedType);
            retValue = ve.getValue(ctx);
    }
    if (escape && retValue != null) {
      retValue = XmlEscape(retValue.toString());
    }
View Full Code Here

Examples of javax.el.ExpressionFactory

            validateFunctions(el, n);

            // test it out
            ELContextImpl ctx = new ELContextImpl();
            ctx.setFunctionMapper(this.getFunctionMapper(el));
            ExpressionFactory ef = this.pageInfo.getExpressionFactory();
            try {
                ef.createValueExpression(ctx, expr, Object.class);
            } catch (ELException e) {

            }
        }
View Full Code Here

Examples of javax.el.ExpressionFactory

        testLocation("some_expression", "some_expression");
    }

    private void testLocation(String configuredValue, String expectedResolvedLocationExpression) {
        String expectedResolvedLocation = "evaluated_location";
        ExpressionFactory expressionFactory = mock(ExpressionFactory.class);
        ValueExpression valueExpression = mock(ValueExpression.class);

        // given
        configure(resourceMappingLocation, (String) expectedResolvedLocationExpression);
        when(application.getExpressionFactory()).thenReturn(expressionFactory);
        when(expressionFactory.createValueExpression(elContext, expectedResolvedLocationExpression, Object.class)).thenReturn(
                valueExpression);
        when(valueExpression.getValue(elContext)).thenReturn(expectedResolvedLocation);

        // when
        String location = ServiceTracker.getService(ResourceMappingConfiguration.class).getLocation();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.