{"dojo.AdapterRegistry":{"meta":{"requires":{"common":["dojo.lang.func"]},"functions":{"dojo.AdapterRegistry":{"meta":{"summary":"A registry to make contextual calling\/searching easier.","parameters":{"returnWrappers":{"type":"Boolean?"}},"src":" this.pairs = [];\n\tthis.returnWrappers = returnWrappers || false;","instance_variables":["pairs","returnWrappers"],"description":"Objects of this class keep list of arrays in the form [name, check, wrap, directReturn] that are used to determine what the contextual result of a set of checked arguments is. All check\/wrap functions in this registry should be of the same arity."}},"dojo.AdapterRegistry.register":{"meta":{"summary":"register a check function to determine if the wrap function or object gets selected","parameters":{"name":{"type":""},"check":{"type":""},"wrap":{"type":"Function"},"directReturn":{"type":""},"override":{"type":""}},"src":"\t\tvar type = (override) ? \"unshift\" : \"push\";\n\t\tthis.pairs[type]([name, check, wrap, directReturn]);","prototype":"dojo.AdapterRegistry"},"extra":{"parameters":{"name":{"type":"String","summary":"a way to identify this matcher."},"check":{"type":"Function","summary":"a function that arguments are passed to from the adapter's match() function. The check function should return true if the given arguments are appropriate for the wrap function."},"directReturn":{"type":"Boolean?","summary":"If directReturn is true, the value passed in for wrap will be returned instead of being called. Alternately, the AdapterRegistry can be set globally to \"return not call\" using the returnWrappers property. Either way, this behavior allows the registry to act as a \"search\" function instead of a function interception library."},"override":{"type":"Boolean?","summary":"If override is given and true, the check function will be given highest priority. Otherwise, it will be the lowest priority adapter."}}}},"dojo.AdapterRegistry.match":{"meta":{"summary":"Find an adapter for the given arguments. If no suitable adapter is found, throws an exception. match() accepts any number of arguments, all of which are passed to all matching functions from the registered pairs.","src":" \tfor(var i = 0; i < this.pairs.length; i++){\n\t\t\tvar pair = this.pairs[i];\n\t\t\tif(pair[1].apply(this, arguments)){\n\t\t\t\tif((pair[3])||(this.returnWrappers)){\n\t\t\t\t\treturn pair[2];\n\t\t\t\t}else{\n\t\t\t\t\treturn pair[2].apply(this, arguments);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthrow new Error(\"No match found\");\n\t\t\/\/ dojo.raise(\"No match found\");","prototype":"dojo.AdapterRegistry"}},"dojo.AdapterRegistry.unregister":{"meta":{"summary":"Remove a named adapter from the registry","parameters":{"name":{"type":""}},"src":"\t\t\/\/ FIXME: this is kind of a dumb way to handle this. On a large\n\t\t\/\/ registry this will be slow-ish and we can use the name as a lookup\n\t\t\/\/ should we choose to trade memory for speed.\n\t\tfor(var i = 0; i < this.pairs.length; i++){\n\t\t\tvar pair = this.pairs[i];\n\t\t\tif(pair[0] == name){\n\t\t\t\tthis.pairs.splice(i, 1);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;","prototype":"dojo.AdapterRegistry"}}}}}}