Examples of FunctionObject


Examples of com.orange.wink.model.FunctionObject

   */
  public static ScriptObject buildScriptObject(final ParseObject po, final ScriptObject parent) throws WinkParseException {
    ScriptObject so;

    if (po instanceof Function) {
      so = new FunctionObject(po.getNode());
    } else if (po instanceof ObjectLit) {
      so = new LiteralObject(po.getNode());
    } else {
      so = new DefaultObject(po.getNode());
    }
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.FunctionObject

                defineProperty("item", new MethodWrapper("item", staticType, new Class[] {Integer.TYPE}),
                        0);

                final Method toString = getClass().getMethod("jsToString",
                        ArrayUtils.EMPTY_CLASS_ARRAY);
                defineProperty("toString", new FunctionObject("toString",
                        toString, this), 0);

                getByIndexMethod_ = item;

                if (NamedNodeMap.class.equals(staticType)) {
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.FunctionObject

        for (final String name : names) {
            final Method method = findMethod(methods, name);
            if (method == null) {
                throw Context.reportRuntimeError("Method \"" + name + "\" not found in \"" + clazz.getName() + '"');
            }
            final FunctionObject f = new FunctionObject(name, method, this);
            defineProperty(name, f, attributes);
        }
    }
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.FunctionObject

    }

    private static void addFunction(final SimpleScriptable scriptable,
            final String jsMethodName, final String javaMethodName) {
        final Method javaFunction = getMethod(scriptable.getClass(), javaMethodName);
        final FunctionObject fo = new FunctionObject(null, javaFunction, scriptable);
        scriptable.defineProperty(jsMethodName, fo, READONLY);
    }
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.FunctionObject

        }

        // eval hack (cf unit tests testEvalScopeOtherWindow and testEvalScopeLocal)
        final Class< ? >[] evalFnTypes = {String.class};
        final Member evalFn = Window.class.getMethod("custom_eval", evalFnTypes);
        final FunctionObject jsCustomEval = new FunctionObject("eval", evalFn, window);
        window.associateValue("custom_eval", jsCustomEval);

        for (final String jsClassName : jsConfig.keySet()) {
            final ClassConfiguration config = jsConfig.getClassConfiguration(jsClassName);
            final Method jsConstructor = config.getJsConstructor();
            if (jsConstructor != null) {
                final Scriptable prototype = prototypesPerJSName.get(jsClassName);
                if (prototype != null) {
                    final FunctionObject jsCtor = new FunctionObject(jsClassName, jsConstructor, window);
                    jsCtor.addAsConstructor(window, prototype);
                }
            }
        }

        // Rhino defines too much methods for us, particularly since implementation of ECMAScript5
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.FunctionObject

            attributes = ScriptableObject.DONTENUM;
        }
        // the functions
        for (final String functionName : config.functionKeys()) {
            final Method method = config.getFunctionMethod(functionName);
            final FunctionObject functionObject = new FunctionObject(functionName, method, scriptable);
            scriptable.defineProperty(functionName, functionObject, attributes);
        }
    }
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.FunctionObject

    }

    private void defineMethod(final String methodName, final Scriptable scope) {
        for (Method method : getClass().getMethods()) {
            if (method.getName().equals(methodName)) {
                final FunctionObject functionObject = new FunctionObject(methodName, method, scope);
                ((ScriptableObject) scope).defineProperty(methodName, functionObject, ScriptableObject.EMPTY);
            }
        }
    }
View Full Code Here

Examples of org.jpedal.objects.raw.FunctionObject

        pdfObject.setDictionary(PdfDictionary.AlternateSpace,altColorSpace);

        i++;

        //read the transform
        PdfObject tintTransform=new FunctionObject(-1,0);

        i=handleColorSpaces(tintTransform, i,  raw);
        pdfObject.setDictionary(PdfDictionary.tintTransform,tintTransform);

        //check for attributes
View Full Code Here

Examples of org.jpedal.objects.raw.FunctionObject

        //allow for no gap
        if(raw[i]!='<')
            i++;

        //read the transform
        PdfObject tintTransform=new FunctionObject(-1,0);

        if(debugColorspace)
            System.out.println(padding + "Separation Reading tintTransform " + (char) raw[i - 1] + (char) raw[i]+(char)raw[i+1]+" into "+tintTransform);

        i=handleColorSpaces(tintTransform, i,  raw);
View Full Code Here

Examples of org.jpedal.objects.raw.FunctionObject

      for(int i=0;i<functionCount;i++){
       
        id=new String(keys[i]);

                if(id.startsWith("<<")){
                    function=new FunctionObject(1);
                    ObjectDecoder objectDecoder=new ObjectDecoder(currentPdfFile.getObjectReader());
                    objectDecoder.readDictionaryAsObject(function,0,keys[i]);
                }else{
                    function=new FunctionObject(id);
            currentPdfFile.readObject(function);
                }
                subFunction[i]=function;
      }
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.