-------------------------------------- Methods -------------------------------------- /*
Creates an object for managing the methods.
977671
function createMethodsManager() {
    var methods = {};

    return {
        addMethod: addMethod,
        setTarget: setTarget
    };

    /*
     * Adds a method that will be available to extend the object.
     *
     * @param {string} name The method name
     * @param {function} [method] The handler for the specified method name.
     * @return {function} The handler for the specified method name.
     */
    function addMethod(name, method) {
        if (method !== undefined) {
            methods[name] = method;
        }
        return methods[name];
    }

    /*
     * Sets the target object to extend.
     *
     * @param {object} target The target object.
     */
    function setTarget(target) {
        var targetMethods = {};
        for (var name in methods) {
            targetMethods[name] = wrapMethod(target, methods[name]);
        }
        return targetMethods;
    }

    /*
     * Wraps the method so that it is executed with the appropriate
     * arguments.
     *
     * @param {object} target The target object.
     * @param {function} method The method to wrap.
     */
    function wrapMethod(target, method) {
        return function() {

            // Put arguments into a real array.
            var methodArgs = [];
            for (var i = 0; i < arguments.length; i++) {
                methodArgs.push(arguments[i]);
            }

            var params = method(target, parseMethodArgs, methodArgs);

            modifyTarget(target,
                params.source,
                params.sourceKeys,
                params.filters,
                params.overrideKeys);
            return this;
        };
    }
}
1054168
function (method, path, parameters) {
    if (path && !parameters) {
      parameters = path;
      path = null;
    }

    path = normalizePath(path);
    if (!path) {
      this.handlers[method] = parameters;
      this.exportHandler(method, null, parameters);
      return;
    }

    var child = this.children[path];
    if (!child) {
      child = this.api(path);
    }
    child.addHandler(method, null, parameters);
  }
105287
def new(*args, &block)
      procedure = find_procedure(:new)
      # in case of collections pass array of elements as one argument for constructor
      if collection? && !(args.size == 1 && args[0].is_a?(Array))
        args = [args]
      end
      result = procedure.exec_with_options(args, { skip_self: true }, &block)
      # TODO: collection constructor should return Array of ObhjectInstance objects
      if collection?
        result
      else
        # TODO: what to do if block is passed to constructor?
        ObjectInstance.create(self, result)
      end
    end
339852
function createAbstractClass(params, constructor) {
        var def,
            savedMembers,
            key,
            value;

        // Handle abstract methods
        if (hasOwn(params, '$abstracts')) {
            savedMembers = params.$abstracts;
            delete params.$abstracts;
        }

        // Create the class definition
        def = Class.$create(params, constructor);
        def[$abstract] = true;

        // Grab binds
        if (savedMembers) {
            for (key in savedMembers) {
                value = savedMembers[key];

                if (value[$bound]) {
                    insert(def[$class].binds, key);
                }
            }
        }

        return def;
    }
1204381
function(methods) {
        var api;
        for (var name in methods) {
            if (methods.hasOwnProperty(name)) {
                api = this._addMethod(name, methods[name]);
            }
        }
        return api;
    }
882150
function initCreate (args) {
    // method name is moduleNameCreate
    var methodName = `${this.name}Create`
    // method signature is moduleName.methodname
    var methodSignature = `${this.moduleName}.${methodName}`
    // capture model to pass to function
    var model = this
    // add create method to module and to object instance
    this.createMeta = immutable.method(methodSignature, function (args) {
        return createMeta(model, args)
    }, {
        // disable freezing args
        freeze: false,
    })
}
723211
function create(context) {
    const settings = Object.assign({}, defaults, context.options[0]);

    function check(setting, node, list, format) {
        const val = settings[setting];
        const lines = list.map(line);

        if ((isLongerThan(val, lines) || isAlways(val)) && hasDuplicates(lines)) {
            const message = messages.always[setting];
            const fix = (f) => f.replaceTextRange(node.range, format(node));
            context.report({ node, message, fix });
        }

        if (isNever(val) && hasMultiple(lines)) {
            const message = messages.never[setting];
            context.report({ node, message });
        }
    }

    return {
        CallExpression(node) {
            if (!isAmdCall(node) || node.arguments.length < 2) return;

            const args = withoutModuleId(node.arguments);
            const deps = args[0];
            const func = args[1];

            if (!isArrayExpr(deps) || !isFunctionExpr(func)) return;

            const indent = indentation(func);

            check("paths", deps, deps.elements, formatPaths(indent));
            check("names", func, func.params, formatNames(indent, context));
        }
    };
}
992999
function (name, methods) {
        //this.callSuper(methods);
        this.name = name;
        this.methods = {};

        if (methods) {
            var n;
            //Add methods
            n = methods.length;
            while (n > 0) {
                n -= 1;
                this.methods[methods[n]] = true;
            }
        }
    }
654937
function methodsAPIObject(vueObj) {
  const methodsArr = vueObj["methods"] || []
  let methods = []
  
  // construct array of objects for public methods
  methodsArr.forEach((method) => {
    const ele = {
      "name": `${method["name"]}`,
      "parameters": `${method["params"].reduce((paramList, param) => {
          paramList += `${param["name"]}: ${param["type"]["name"]} - ${param["description"]}\n`
          return paramList
      }, '')}`,
      "description": `${method["description"] || 'MISSING DESCRIPTION'}`
    }
    methods.push(ele)
  })
  return methods.length > 0 ? {methods} : null
}
1198534
function createMethod(category, method) {
    return function () {
        var args = Array.prototype.slice.call(arguments);
        var logger = log4js.getLogger(category);

        return logger[method].apply(logger, args);
    };
}
719275
public Method createPojoMethod() {
        Method method = null;
        TargetMetaRequest targetMetaRequest = targetMetaRequestsHolder.getTargetMetaRequest();
        TargetMetaDef targetMetaDef = targetMetaRequest.getTargetMetaDef();
        MethodMetaArgs methodMetaArgs = targetMetaRequest.getMethodMetaArgs();        
        Debug.logVerbose("[JdonFramework] createPOJO Method :" + methodMetaArgs.getMethodName() + " for target service: " + targetMetaDef.getName(), module);        
        try {       
            Class thisCLass = containerCallback.getContainerWrapper().getComponentClass(targetMetaDef.getName());            
            if (thisCLass == null) return null;
            method = thisCLass.getMethod(methodMetaArgs.getMethodName(),
                    methodMetaArgs.getParamTypes());
        } catch (NoSuchMethodException ne) {
            Debug.logError("[JdonFramework] method name:"
                    + methodMetaArgs.getMethodName() + " or method parameters type don't match with your service's method", module);
            Object types[] = methodMetaArgs.getParamTypes();
            for(int i = 0; i<types.length; i ++){
                Debug.logError("[JdonFramework]service's method parameter type must be:" + types[i] + "; ", module);                
            }
        } catch (Exception ex) {
            Debug.logError("[JdonFramework] createPojoMethod error: " + ex, module);
        }
        
        return method;

    }
1287039
function wrapObject(object, methods) {
      if (!(methods instanceof Array)) methods = Array.prototype.slice.call(arguments, 1);
      methods.forEach(function (method) {
        object[method] = wrap(object[method]);
      });
    }
887578
public Method createMethod(TargetServiceFactory targetServiceFactory) {
        Method method = null;
        Debug.logVerbose("[JdonFramework] enter create the Method " , module);
        try {
        	TargetMetaRequest targetMetaRequest = targetMetaRequestsHolder.getTargetMetaRequest();
            if (targetMetaRequest.getTargetMetaDef().isEJB()) { 
                Object obj= methodInvokerUtil.createTargetObject(targetServiceFactory);
                method = createObjectMethod(obj, targetMetaRequest.getMethodMetaArgs());
            }else{
                method = createPojoMethod();
            }
        } catch (Exception ex) {
            Debug.logError("[JdonFramework] createMethod error: " + ex, module);
        }
        
        return method;

    }
219971
@Override
  public <V> MethodVault<V> newMethod(Class<?> type, 
                                      String methodName,
                                      Class<?> []paramTypes)
  {
    Objects.requireNonNull(type);
    
    MethodVault<V> method = newMethodRec(type, methodName, paramTypes);

    if (method != null) {
      return method;
    }
    
    throw new IllegalStateException(L.l("Unknown method {0}.{1} {2}",
                                        type.getSimpleName(),
                                        methodName,
                                        Arrays.asList(paramTypes)));
  }
1000786
public Method createObjectMethod(Object ownerClass, MethodMetaArgs methodMetaArgs) {
        Method m = null;        
        try {
            m = ownerClass.getClass().getMethod(methodMetaArgs.getMethodName(), 
                                                methodMetaArgs.getParamTypes());
        } catch (NoSuchMethodException nsme) {
            String errS = " NoSuchMethod:" + methodMetaArgs.getMethodName() + " in MethodMetaArgs of className:"
                    + ownerClass.getClass().getName();
            Debug.logError(errS, module);
        } catch (Exception ex) {
            Debug.logError("[JdonFramework] createMethod error:" + ex, module);
        }
        return m;
    }
15468
function ( obj ) {
		var methods = [
			["fire",      function () { return observer.fire.apply( observer, [this].concat( array.cast( arguments ) ) ); }],
			["listeners", function ( event ) { return observer.list(this, event ); }],
			["on",        function ( event, listener, id, scope, standby ) { return observer.add( this, event, listener, id, scope, standby ); }],
			["once",      function ( event, listener, id, scope, standby ) { return observer.once( this, event, listener, id, scope, standby ); }],
			["un",        function ( event, id ) { return observer.remove( this, event, id ); }]
		];

		array.each( methods, function ( i ) {
			utility.property( obj, i[0], {value: i[1], configurable: true, enumerable: true, writable: true} );
		});

		return obj;
	}
762905
public Method createMethod(C object, String methodName, Class[] parameterTypes) throws NoSuchMethodException {
        Class clazz = object.getClass();

        try {
            @SuppressWarnings("unchecked")
            Method method = clazz.getMethod(methodName, parameterTypes);
            return method;

        } catch (NoSuchMethodException nsme) {
            String info = "The specified class " + clazz.getName();
            info += " does not have a method \"" + methodName + "\" as expected: ";
            info += nsme.getMessage();
            throw new NoSuchMethodException(info);
        }
    }