/*
When there is a need to add a target callback manually use this method.
558253
public Parser<RECORD> addParseTarget(final Method method,
                               final SetterPolicy setterPolicy,
                               final List<String> fieldValues) {
        assembled = false;

        if (method == null || fieldValues == null) {
            return this; // Nothing to do here
        }

        final Class<?>[] parameters = method.getParameterTypes();
        if (
                // Setters that receive a String
                ((parameters.length == 1) && (parameters[0] == String.class)) ||
                ((parameters.length == 2) && (parameters[0] == String.class) && (parameters[1] == String.class)) ||

                // Setters that receive a Long
                ((parameters.length == 1) && (parameters[0] == Long.class)) ||
                ((parameters.length == 2) && (parameters[0] == String.class) && (parameters[1] == Long.class)) ||

                // Setters that receive a Double
                ((parameters.length == 1) && (parameters[0] == Double.class)) ||
                ((parameters.length == 2) && (parameters[0] == String.class) && (parameters[1] == Double.class))
        ) {
            for (final String fieldValue : fieldValues) {
                if (fieldValue == null) {
                    continue;
                }
                String cleanedFieldValue = cleanupFieldValue(fieldValue);
                if (!fieldValue.equals(cleanedFieldValue)) {
                    LOG.warn("The requested \"{}\" was converted into \"{}\"", fieldValue, cleanedFieldValue);
                }

                // We have 1 real target
                Set<Pair<Method, SetterPolicy>> fieldTargets = targets.computeIfAbsent(cleanedFieldValue, k -> new HashSet<>());
                fieldTargets.add(Pair.of(method, setterPolicy));
                targets.put(cleanedFieldValue, fieldTargets);

                // We have 1 real target
                Set<Pair<List<String>, SetterPolicy>> fieldTargetNames = targetsMethodNames.get(cleanedFieldValue);
                if (fieldTargetNames == null) {
                    fieldTargetNames = new HashSet<>();
                }
                List<String> methodList = new ArrayList<>();
                methodList.add(method.getName());
                for (Class<?> clazz: method.getParameterTypes()) {
                    methodList.add(clazz.getCanonicalName());
                }
                fieldTargetNames.add(Pair.of(methodList, setterPolicy));
                targetsMethodNames.put(cleanedFieldValue, fieldTargetNames);
            }
        } else {
            throw new InvalidFieldMethodSignature(method);
        }
        return this;
    }
1273251
function(target, event, callback, traditional) {
			if(_.type(target) === 'string' || _.type(target) === 'array') {
				var elements = _.type(target) === 'string'? $$(target) : target;
				
				elements.forEach(function(element) {
					_.event.bind(element, event, callback, traditional);
				});
			}
			else if(_.type(event) === 'string') {
				if(traditional) {
					target['on' + event] = callback;
				}
				else {
					target.addEventListener(event, callback, false);
				}
			}
			else if(_.type(event) === 'array') {
				for (var i=0; i<event.length; i++) {
					_.event.bind(target, event[i], callback, arguments[2]);
				}
			}
			else {
				for (var name in event) {
					_.event.bind(target, name, event[name], arguments[2]);
				}
			}
		}
856212
def add_callback(self, fn, *args, **kwargs):
        """"""
        if _debug: IOCB._debug("add_callback(%d) %r %r %r", self.ioID, fn, args, kwargs)

        # store it
        self.ioCallback.append((fn, args, kwargs))

        # already complete?
        if self.ioComplete.isSet():
            self.trigger()
48054
public void executeMethod(final Class<?> targetClass, final Method targetMethod, final Object[] methodArgs)
            throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {

        addImplementationClasses(targetClass);

        if (methodArgs != null) {
            targetMethod.invoke(instanceMap.get(targetClass), methodArgs);
        } else {
            targetMethod.invoke(instanceMap.get(targetClass));
        }
    }
1268202
public static <OriginObject, TargetObject> void append(OriginObject originObject, TargetObject targetObject) {
        if (originObject == null) {
            return;
        }
        if (targetObject == null) {
            throw new IllegalArgumentException("targetClass can't be null");
        }
        @SuppressWarnings("unchecked")
        Class<TargetObject> targetClass = (Class<TargetObject>) targetObject.getClass();
        setValue(originObject, targetObject, targetClass);

    }
1195911
public void addTarget(final AjaxTarget target) {
		AjaxControlModel model = getOrCreateComponentModel();

		if (model.targets == null) {
			model.targets = new ArrayList<>();
		}

		model.targets.add(target);
		MemoryUtil.checkSize(model.targets.size(), this.getClass().getSimpleName());
	}
1371840
public void attach () {
		if (target == null) return;
		Array<EventListener> listeners = target.getListeners();
		for (EventListener listener : listeners) {
			if (listener instanceof TooltipInputListener) {
				throw new IllegalStateException("More than one tooltip cannot be added to the same target!");
			}
		}

		target.addListener(listener);
	}
9573
function addEvent(target, name, callback, capture) {
      if (target.addEventListener) {
        target.addEventListener(name, callback, capture || false);
      } else if (target.attachEvent) {
        target.attachEvent('on' + name, callback);
      }
    }
69010
def add_callback(self, callback, *callback_args, **callback_kwargs):
        """"""
        return self.add_callbacks(callback, callback_args=callback_args,
                           callback_kwargs=callback_kwargs)
515592
function _makeJSTarget(targets, callFrame) {
        var script = ScriptAgent.scriptWithId(callFrame.location.scriptId);
        if (script && script.url) {
            var url = script.url;
            url += ":" + callFrame.location.lineNumber + "," + callFrame.location.columnNumber;
            var name = callFrame.functionName;
            if (name === "") {
                name = "anonymous function";
            }
            var file = _fileFromURL(url);
            targets.push({"type": "js", "url": url, "name": name, "file": file});
        }
    }
951010
private void processCallback(final Callback callback) {
        try {
            JsonNode result = handleCallback(callback);
            this.getClient().completeCallback(callback, null, result);
        } catch (JsiiException e) {
            this.getClient().completeCallback(callback, e.getMessage(), null);
        }
    }
602542
@MainThread
    private void handleRegistration(Object targetObj) {
        if (targetObj == null) {
            throw new NullPointerException("Target cannot be null");
        }

        for (EventTarget target : targets) {
            if (target.targetObj == targetObj) {
                Utils.logE(targetObj, "Already registered");
                return;
            }
        }

        EventTarget target = new EventTarget(targetObj);
        targets.add(target);

        Utils.log(targetObj, "Registered");

        scheduleActiveStatusesUpdates(target, EventStatus.STARTED);
        executeTasks(false);
    }
413719
public Callbacks add(com.google.gwt.core.client.Callback<?, ?>... c) {
    addAll((Object[]) c);
    return this;
  }
1113581
def add_callback(self, callback=None, errorback=None):
        
        self._callback = callback
        self._errorback = errorback
1211935
function () {
            // get value
            var val = this.getContextValue();

            var target,
                targets = this.$.root.getTargets();
            if (targets) {
                for (var i = 0; i < targets.length; i++) {
                    target = targets[i];
                    if (target.key instanceof Function) {
                        target.key.call(target.scope, val, this);
                    } else {
                        target.scope.set(target.key, val);
                    }
                }
            }

        }
872519
@Override
    public void setTarget(Object target) {
        if (mTarget != target) {
            final Object oldTarget = mTarget;
            mTarget = target;
            if (oldTarget != null && target != null && oldTarget.getClass() == target.getClass()) {
                return;
            }
            // New target type should cause re-initialization prior to starting
            mInitialized = false;
        }
    }
182448
function addListener(target, eventType, fn) {
		target.attachEvent(eventType, fn);
		listenersArr[listenersArr.length] = [target, eventType, fn];
	}