Adds the call back method.

@param metadata
the metadata
@param jpaAnnotation
the jpa annotation
@param callbackMethod
the callback method
544017
@SuppressWarnings("unchecked")
    private void addCallBackMethod(EntityMetadata metadata, Class<?> jpaAnnotation, CallbackMethod callbackMethod)
    {
        Map<Class<?>, List<? extends CallbackMethod>> callBackMethodsMap = metadata.getCallbackMethodsMap();
        List<CallbackMethod> list = (List<CallbackMethod>) callBackMethodsMap.get(jpaAnnotation);
        if (null == list)
        {
            list = new ArrayList<CallbackMethod>();
            callBackMethodsMap.put(jpaAnnotation, list);
        }
        list.add(callbackMethod);
    }
468052
@Nonnull
    public BugInstance addCalledMethod(String className, String methodName, String methodSig, boolean isStatic) {
        return addMethod(MethodAnnotation.fromCalledMethod(className, methodName, methodSig, isStatic)).describe(
                MethodAnnotation.METHOD_CALLED);
    }
128162
@SuppressWarnings("unused")
    @Internal
    @UsedByGeneratedCode
    protected final AbstractBeanDefinition<T> addExecutableMethod(ExecutableMethod<T, ?> executableMethod) {
        MethodKey key = new MethodKey(executableMethod.getMethodName(), executableMethod.getArgumentTypes());
        executableMethodMap.put(key, executableMethod);
        return this;
    }
813112
function(clazz, metaData) {
        this.applyMethods(clazz, metaData.clazz_methods || {});
        this.applyMethods(clazz.prototype, metaData.methods || {});
    }
261261
private void addAnnotation(final Class<? extends Annotation> clazz) {
        final List<? extends Annotation> annotations = ReflectionUtils.getAnnotations(getClazz(), clazz);
        for (final Annotation ann : annotations) {
            addAnnotation(clazz, ann);
        }
    }
1036442
public static List<AnnotationInstance> createMethodAnnotationList(final MethodInfo method) {
        final List<AnnotationInstance> result = new ArrayList<>();
        for (AnnotationInstance ai : method.annotations()) {
            final AnnotationTarget at = ai.target();
            if (at.kind() == AnnotationTarget.Kind.METHOD) {
                result.add(ai);
            }
        }
        return result;
    }
915544
private void callAnnotatedMethod(final Class<? extends Annotation> annotationClass) {
        if (this.lifecycleMethod.get(annotationClass.getName()) != null) {
            for (final Method method : this.lifecycleMethod.get(annotationClass.getName())) {

                try {
                    ClassUtility.callMethod(method, this);
                } catch (final CoreException e) {
                    LOGGER.error(CALL_ANNOTATED_METHOD_ERROR, e);
                }
            }
        }
    }
985049
private void fillMethods(final SQLiteDaoDefinition currentDaoDefinition, Element daoElement) {
		final One<Boolean> methodWithAnnotation=new One<Boolean>(false);
		
		// create method for dao
		SqlBuilderHelper.forEachMethods((TypeElement) daoElement, new MethodFoundListener() {

			@Override
			public void onMethod(ExecutableElement element) {
				if (excludedMethods.contains(element.getSimpleName().toString()))
					return;

				methodWithAnnotation.value0=false;
				final List<ModelAnnotation> annotationList = new ArrayList<>();

				// optional annotations
				final List<ModelAnnotation> supportAnnotationList = new ArrayList<>();

				AnnotationUtility.forEachAnnotations(element, new AnnotationFoundListener() {

					@Override
					public void onAcceptAnnotation(Element element, String annotationClassName,
							Map<String, String> attributes) {

						if // @formatter:off
						(annotationClassName.equals(BindSqlInsert.class.getCanonicalName())
								|| annotationClassName.equals(BindSqlUpdate.class.getCanonicalName())
								|| annotationClassName.equals(BindSqlDelete.class.getCanonicalName())
								|| annotationClassName.equals(BindSqlSelect.class.getCanonicalName())
								|| annotationClassName.equals(BindContentProviderEntry.class.getCanonicalName()))
						// @formatter:on
						{
							if (!annotationClassName.equals(BindContentProviderEntry.class.getCanonicalName())) {
								methodWithAnnotation.value0=true;	
							}
							
							ModelAnnotation annotation = new ModelAnnotation(annotationClassName, attributes);
							annotationList.add(annotation);
						}
						// we don't insert annotation

					}
				});
										
				annotationList.addAll(supportAnnotationList);
				final SQLiteModelMethod currentMethod = new SQLiteModelMethod(currentDaoDefinition, element,
						annotationList);
				
				AssertKripton.assertTrueOrInvalidMethodSignException(methodWithAnnotation.value0,  currentMethod, "method must be annotated with @%s, @%s, @%s or @%s",
						BindSqlSelect.class.getSimpleName(),
						BindSqlInsert.class.getSimpleName(),
						BindSqlUpdate.class.getSimpleName(),
						BindSqlDelete.class.getSimpleName());
						// annotated", currentDaoDefinition.getName(),
						// element.getSimpleName());

				addWithCheckMethod(currentDaoDefinition, currentMethod);
			}

			private void addWithCheckMethod(SQLiteDaoDefinition currentDaoDefinition, SQLiteModelMethod newMethod) {
				SQLiteModelMethod oldMethod = currentDaoDefinition.findPropertyByName(newMethod.getName());

				// ASSERT: same name and same number
				if (oldMethod != null && oldMethod.getParameters().size() == newMethod.getParameters().size()) {
					boolean sameParameters = true;
					for (int i = 0; i < oldMethod.getParameters().size(); i++) {
						if (!oldMethod.getParameters().get(i).value1.equals(newMethod.getParameters().get(i).value1)) {
							sameParameters = false;
							break;
						}
					}

					AssertKripton.failWithInvalidMethodSignException(sameParameters, newMethod,
							"conflict between generated method and declared method.");
				}

				// add method
				currentDaoDefinition.add(newMethod);

			}

		});
	}
967988
public static Predicate<RequestHandler> withMethodAnnotation(final Class<? extends Annotation> annotation) {
    return input -> input.isAnnotatedWith(annotation);
  }
69536
@SuppressWarnings("unchecked")
	public <T extends Annotation> T getMethodAnnotation(Class<T> annotationType) {
		return (this.method != null ? this.method.getAnnotation(annotationType) :
				(T) this.constructor.getAnnotation(annotationType));
	}
461646
private void visitMethod(Node member, ClassDeclarationMetadata metadata) {
    Node qualifiedMemberAccess = getQualifiedMemberAccess(member, metadata);
    Node method = member.getLastChild().detach();

    // Use the source info from the method (a FUNCTION) not the MEMBER_FUNCTION_DEF
    // because the MEMBER_FUNCTION_DEf source info only corresponds to the identifier
    Node assign =
        astFactory.createAssign(qualifiedMemberAccess, method).useSourceInfoIfMissingFrom(method);

    JSDocInfo info = member.getJSDocInfo();
    if (member.isStaticMember() && NodeUtil.referencesThis(assign.getLastChild())) {
      JSDocInfoBuilder memberDoc = JSDocInfoBuilder.maybeCopyFrom(info);
      memberDoc.recordThisType(
          new JSTypeExpression(new Node(Token.BANG, new Node(Token.QMARK)),
          member.getSourceFileName()));
      info = memberDoc.build();
    }
    if (info != null) {
      assign.setJSDocInfo(info);
    }

    Node newNode = NodeUtil.newExpr(assign);
    metadata.insertNodeAndAdvance(newNode);
  }
230288
@ResponseBody
    @PostMapping("/webhook")
    public final ResponseEntity setupWebhookEndpoint(@RequestBody Callback callback) {
        try {
            // Checks this is an event from a page subscription
            if (!callback.getObject().equals("page")) {
                return new ResponseEntity<>(HttpStatus.NOT_FOUND);
            }
            logger.debug("Callback from fb: {}", callback);
            for (Entry entry : callback.getEntry()) {
                if (entry.getMessaging() != null) {
                    for (Event event : entry.getMessaging()) {
                        if (event.getMessage() != null) {
                            if (event.getMessage().isEcho() != null &&
                                    event.getMessage().isEcho()) {
                                event.setType(EventType.MESSAGE_ECHO);
                            } else if (event.getMessage().getQuickReply() != null) {
                                event.setType(EventType.QUICK_REPLY);
                            } else {
                                event.setType(EventType.MESSAGE);
                                // send typing on indicator to create a conversational experience
                                sendTypingOnIndicator(event.getSender());
                            }
                        } else if (event.getDelivery() != null) {
                            event.setType(EventType.MESSAGE_DELIVERED);
                        } else if (event.getRead() != null) {
                            event.setType(EventType.MESSAGE_READ);
                        } else if (event.getPostback() != null) {
                            event.setType(EventType.POSTBACK);
                        } else if (event.getOptin() != null) {
                            event.setType(EventType.OPT_IN);
                        } else if (event.getReferral() != null) {
                            event.setType(EventType.REFERRAL);
                        } else if (event.getAccountLinking() != null) {
                            event.setType(EventType.ACCOUNT_LINKING);
                        } else {
                            logger.debug("Callback/Event type not supported: {}", event);
                            return ResponseEntity.ok("Callback not supported yet!");
                        }
                        if (isConversationOn(event)) {
                            invokeChainedMethod(event);
                        } else {
                            invokeMethods(event);
                        }
                    }
                }
            }
        } catch (Exception e) {
            logger.error("Error in fb webhook: Callback: {} \nException: ", callback.toString(), e);
        }
        // fb advises to send a 200 response within 20 secs
        return ResponseEntity.ok("EVENT_RECEIVED");
    }
752267
void callAnnotated(Class<? extends Annotation> ann, boolean lazy) {
        for (ComponentAccess p : oMap.values()) {
            p.callAnnotatedMethod(ann, lazy);
        }
    }
1290616
private void addCompilationErrorOnCustomMethodNode(InnerClassNode node, String methodName, Parameter[] parameters) {
        MethodNode existingMethodNode = node.getMethod(methodName, parameters);
        // if there is a user-defined methodNode, add compiler error msg and continue
        if (existingMethodNode != null && !isSynthetic(existingMethodNode))  {
            addError("\"" +methodName + "\" implementations are not supported on static inner classes as " +
                    "a synthetic version of \"" + methodName + "\" is added during compilation for the purpose " +
                    "of outer class delegation.",
                    existingMethodNode);
        }
    }
396532
public void registerCallback(UOWCallback callback)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "registerCallback", callback);

        if (!_callbacks.contains(callback))
        {
            _callbacks.add(callback);

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Number of registered Callbacks: "+_callbacks.size());
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "registerCallback");
    }
1289036
@Override
    public void beginMetaData(MetaData metadata)
    {
        for (Listener listener : this.listeners) {
            listener.beginMetaData(metadata);
        }
    }
325959
public List<CallbackMetadata> getCallbacks(CallbackType callbackType) {
    return callbacks == null ? null : callbacks.get(callbackType);
  }