Package org.codehaus.janino

Examples of org.codehaus.janino.Scanner


  public RexExecutable(String code, Object reason) {
    try {
      //noinspection unchecked
      compiledFunction =
          (Function1) ClassBodyEvaluator.createFastClassBodyEvaluator(
              new Scanner(null, new StringReader(code)),
              GENERATED_CLASS_NAME,
              Utilities.class,
              new Class[] {Function1.class, Serializable.class},
              getClass().getClassLoader());
    } catch (CompileException e) {
View Full Code Here


    return getBlock();
    }

  protected String[] guessParameterNames() throws CompileException, IOException
    {
    return ExpressionEvaluator.guessParameterNames( new Scanner( "expressionEval", new StringReader( block ) ) );
    }
View Full Code Here

      String body = IO.toString(is);

      //TODO: Hack to remove annotations so Janino doesn't choke.  Need to reconsider this problem...
      body = body.replaceAll("@\\w+(?:\\([^\\\\]*?\\))?", "");
      try{
        cu = new Parser(new Scanner(null, new StringReader(body))).parseCompilationUnit();
        functionUnits.put(path, cu);
        return cu;
      } catch (CompileException e) {
        logger.warn("Failure while parsing function class:\n{}", body, e);
        return null;
View Full Code Here

          }
        }

      StringReader stringReader = new StringReader( buf.toString() );
      ClassLoader classLoader = JaninoFactory.class.getClassLoader();
      ClassBodyEvaluator evaluator = new ClassBodyEvaluator( new Scanner( null, stringReader ), abstractClass, new Class[ 0 ], classLoader );

      cachedTargetType = evaluator.getClazz();
      targetType = cachedTargetType;
      }
    else
View Full Code Here

TOP

Related Classes of org.codehaus.janino.Scanner

Copyright © 2018 www.massapicom. 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.