Examples of CompiledExpression


Examples of org.mvel2.compiler.CompiledExpression

        if ( pkg != null ) {
            MVELDialectRuntimeData data = (MVELDialectRuntimeData) pkg.getDialectRuntimeRegistry().getDialectData( this.id );
            factory.setNextFactory( data.getFunctionFactory() );
        }

        CompiledExpression compexpr = (CompiledExpression) this.expr;

        Object value;
        if ( MVELDebugHandler.isDebugMode() ) {
            if ( MVELDebugHandler.verbose ) {
                System.out.println( DebugTools.decompile( compexpr ) );
View Full Code Here

Examples of org.mvel2.compiler.CompiledExpression

      MVELDialectRuntimeData data = (MVELDialectRuntimeData) pkg
          .getDialectRuntimeRegistry().getDialectData(this.id);
      factory.setNextFactory(data.getFunctionFactory());
    }

    CompiledExpression compexpr = (CompiledExpression) this.expr;

    pkg = knowledgeHelper.getWorkingMemory().getRuleBase().getPackage(
        knowledgeHelper.getRule().getPackage());

    ClassLoader tempClassLoader = Thread.currentThread()
        .getContextClassLoader();
    Thread.currentThread().setContextClassLoader(
        ((InternalRuleBase) workingMemory.getRuleBase())
            .getRootClassLoader());

    try {
          if (MVELDebugHandler.isDebugMode()) {
              if (MVELDebugHandler.verbose) {
                  System.out.println("Executing expression " + compexpr.getSourceName());
                  System.out.println(DebugTools.decompile(compexpr));
              }
              MVEL.executeDebugger(compexpr, null, factory);
          } else {
              MVEL.executeExpression(compexpr, null, factory);
View Full Code Here

Examples of org.mvel2.compiler.CompiledExpression

                object.getClass());
    }

    protected Boolean isSuccess(VerifyField currentField) {
        String s = "__fact__." + currentField.getFieldName() + " " + currentField.getOperator() + " __expected__";
        CompiledExpression expression = new ExpressionCompiler(s).compile(parserContext);

        return (Boolean) MVEL.executeExpression(expression,
                variables);
    }
View Full Code Here

Examples of org.xmldb.api.base.CompiledExpression

        System.out.println("query: " + query);
        try {
            XQueryService service = (XQueryService) collection.getService("XQueryService", "1.0");
            service.declareVariable("filename", "");
            service.declareVariable("count", "0");
            CompiledExpression compiled = service.compile(query);

            for (int i = 0; i < count; i++) {
                generatedFiles[i] = File.createTempFile(prefix, ".xml");

                service.declareVariable("filename", generatedFiles[i].getName());
View Full Code Here

Examples of org.xmldb.api.base.CompiledExpression

      query.append("$doc := xdb:store(\"" + eXistUrl + XmldbURI.ROOT_COLLECTION + "\", $document, $survey)");
      query.append("return <result/>");
 
      service.declareVariable("survey", xml);
      service.declareVariable("document", document);
      CompiledExpression cQuery = service.compile(query.toString());
      service.execute(cQuery);
        } catch (Exception e) {           
            fail(e.getMessage());
        }         
  }
View Full Code Here

Examples of org.xmldb.api.base.CompiledExpression

      query.append("xquery version \"1.0\";");
      query.append("let $survey := xmldb:document(concat('" + XmldbURI.ROOT_COLLECTION + "', $document))");
      query.append("return ($survey)");
       
      service.declareVariable("document", document);
      CompiledExpression cQuery = service.compile(query.toString());
      ResourceSet set = service.execute(cQuery);
      if (set != null && set.getSize() > 0) {
        return ((XMLResource)set.getIterator().nextResource()).getContentAsDOM();
      }     
        } catch (Exception e) {           
View Full Code Here

Examples of org.xmldb.api.base.CompiledExpression

    query.append("return <result/>");

    try {
      service.declareVariable("survey", xml);
      service.declareVariable("document", document);
      CompiledExpression cQuery = service.compile(query.toString());
      service.execute(cQuery);
    } catch(Exception e) {     
      fail(e.getMessage());
    }     
  }
View Full Code Here

Examples of org.xmldb.api.base.CompiledExpression

    query.append("xquery version \"1.0\";");
    query.append("let $survey := xmldb:document(concat('" + XmldbURI.ROOT_COLLECTION + "', '/', $document))");
    query.append("return ($survey)");   
    try {
      service.declareVariable("document", document);
      CompiledExpression cQuery = service.compile(query.toString());
      ResourceSet set = service.execute(cQuery);
      assertNotNull(set);
      assertTrue(set.getSize() > 0);
      return ((XMLResource)set.getIterator().nextResource()).getContentAsDOM();     
    } catch(Exception e) {     
View Full Code Here

Examples of org.xmldb.api.base.CompiledExpression

  public void testResourceSet() {
    try {
      String query = "//SPEECH[SPEAKER = 'HAMLET']";
      XQueryService service = (XQueryService) testCollection.getService("XQueryService", "1.0");
      service.setProperty("highlight-matches", "none");
      CompiledExpression compiled = service.compile(query);
      ResourceSet result = service.execute(compiled);
     
      assertEquals(result.getSize(), 359);
     
      for (int i = 0; i < result.getSize(); i++) {
View Full Code Here

Examples of org.xmldb.api.base.CompiledExpression

      service.setNamespace("tm-query", "http://exist-db.org/test/module/query");
           
      service.declareVariable("tm:imported-external-string", "imported-string-value");
      service.declareVariable("tm-query:local-external-string", "local-string-value");
     
      CompiledExpression compiled = service.compile(query);
      ResourceSet result = service.execute(compiled);
     
      assertEquals(result.getSize(), 2);
     
      for (int i = 0; i < result.getSize(); i++) {
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.