Package de.matrixweb.ne

Examples of de.matrixweb.ne.StringFunctor


  /**
   * @param name
   * @param clazz
   */
  public JavaScriptExecutorV8(final String name, final Class<?> clazz) {
    this.engine = new NativeEngine(new StringFunctor("require") {
      @Override
      public String call(final String require) {
        final String module = "/" + name + "/" + require + ".js";
        try {
          final InputStream in = clazz.getResourceAsStream(module);
View Full Code Here


  public void addGlobalFunction(final String name, final Object object,
      final String method) {
    try {
      final Method javaMethod = object.getClass().getMethod(method,
          String.class);
      this.engine.addCallbackFunction(new StringFunctor(name) {
        @Override
        public String call(final String input) {
          try {
            final Object result = javaMethod.invoke(object, input);
            return result == null ? null : result.toString();
View Full Code Here

TOP

Related Classes of de.matrixweb.ne.StringFunctor

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.