Return the name of the event to emit for a given method. Expect the method to be annotated with
{@link Emit}.

@param method The method to convert
@return The name of the event
480530
public static String methodToEventName(ExecutableElement method) {
    Emit emitAnnotation = method.getAnnotation(Emit.class);
    if (!"".equals(emitAnnotation.value())) {
      return emitAnnotation.value();
    }

    return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, method.getSimpleName().toString())
        .toLowerCase();
  }
497989
public static String getEntryPointDecoratedName(Method method, boolean scanEntryPointAnnotation) {
		String decoratedName = method.getName();

		if (scanEntryPointAnnotation) {
			// we look at the method level
			if (method.isAnnotationPresent(ExternalEntryPoint.class)) {
				final ExternalEntryPoint externalEntryPoint = method.getAnnotation(ExternalEntryPoint.class);
	
				if (StringUtils.isNotBlank(externalEntryPoint.name())) {
					decoratedName = externalEntryPoint.name();
				}
			}
		}

		return decoratedName;
	}
1255534
public static String getSetKey(ExecutableElement method) {
    StringBuilder result = new StringBuilder();
    AnnotationMirror qualifier = getQualifier(method.getAnnotationMirrors());
    if (qualifier != null) {
      qualifierToString(qualifier, result);
    }
    result.append(SET_PREFIX);
    typeToString(method.getReturnType(), result, '$');
    result.append(">");
    return result.toString();
  }
399318
@Override
	@Nullable
	public String getMapping(Method method) {

		Assert.notNull(method, "Method must not be null!");
		return getMapping(method.getDeclaringClass(), method);
	}
1334940
private String getInvokerMethodName(MethodLiteral<?, ?> method,
      NameGenerator nameGenerator) throws NoSourceNameException {
    Class<?> methodDeclaringType = method.getRawDeclaringType();
    String invokeeTypeName = ReflectUtil.getSourceName(methodDeclaringType);
    String methodBaseName = nameGenerator.convertToValidMemberName(
        String.format("%s_%s_methodInjection", invokeeTypeName, method.getName()));

    return nameGenerator.createMethodName(methodBaseName);
  }
799908
protected String extractPropertyName(Method method) {
		String name = method.getName();
		name = name.startsWith("is") ? name.substring(NUM_2) : name.substring(NUM_3);
		return name;
	}
471416
private String getParameterName(AnnotatedParameter<?> parameter) {
        try {
            Method method = Method.class.getMethod("getParameters");
            Object[] parameters = (Object[]) method.invoke(parameter.getDeclaringCallable().getJavaMember());
            Object param = parameters[parameter.getPosition()];
            Class<?> Parameter = Class.forName("java.lang.reflect.Parameter");
            if ((Boolean) Parameter.getMethod("isNamePresent").invoke(param))
                return (String) Parameter.getMethod("getName").invoke(param);
            else
                throw new UnsupportedOperationException("Unable to retrieve name for parameter [" + parameter
                                                        + "], activate the -parameters compiler argument or annotate the injected parameter with the @Metric annotation");
        } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | ClassNotFoundException cause) {
            throw new UnsupportedOperationException("Unable to retrieve name for parameter [" + parameter
                                                    + "], @Metric annotation on injected parameter is required before Java 8");
        }
    }
14857
private static String superMethodName(Method method) {
        String returnType = method.getReturnType().getName();
        return "super$" + method.getName() + "$"
                + returnType.replace('.', '_').replace('[', '_').replace(';', '_');
    }
582869
public static String convertMethodSignature(JavaClass javaClass, Method method) {
        return convertMethodSignature(javaClass.getClassName(), method.getName(), method.getSignature());
    }
593329
public static BeanParser getBeanParser(Method method) {
    Type returnType = method.getReturnType();
    if (isCompletableFutureType(method.getReturnType())) {
      returnType = getActualReturnType(method);
    }
    BeanParser beanParser = typeBeanParserMap.get(returnType);
    if (beanParser != null) {
      return beanParser;
    }
    return defaultBeanParser;
  }
130971
public MethodDoc getMatchingMethod(MethodDoc method) {

        MethodDoc[] methods = getMethods();
        for (int i = 0; i < methods.length; i++) {

            if (method.getName().equals(methods[i].getName()) &&
                method.getSignature().equals(methods[i].getSignature())) {

                return methods[i];
            }
        }
        return null;
    }
420057
public String getAction(final Class<?> clazz, final Method method) {
        final Annotation[] annotations = clazz.getAnnotations();
        return this.getAction(annotations, method);
    }
1118957
public Method getEventMethod(Class controlInterface)
    {
        //
        // If we already hold a method reference and its loader matches up with the input
        // interface, then just return it.
        //
        if (_method != null &&
            _method.getDeclaringClass().getClassLoader().equals(controlInterface.getClassLoader()))
            return _method;

        //
        // Otherwise, obtain the mapping from descriptors to methods, and use it to
        // convert back to a method.
        //
        String eventDescriptor = getEventDescriptor(controlInterface); 
        HashMap<String,Method> descriptorMap = getDescriptorMap(controlInterface);
        if (!descriptorMap.containsKey(eventDescriptor))
        {
            throw new IllegalArgumentException("Control interface " + controlInterface + 
                                               " does not contain an event method that " +
                                               " corresponds to " + eventDescriptor);
        }
        return descriptorMap.get(eventDescriptor);
    }
826213
public String getFullFunctionName(ExecutableElement method) {
    return getFullName(ElementUtil.getDeclaringClass(method)) + '_' + getFunctionName(method);
  }
86115
String getCppName(Method method) {
        ClassMapping mapping = mappings.get(method.getDeclaringClass());

        if (mapping != null) {
            String name = method.getName() + "(" + Datatype.generateJNISignature(method.getParameterTypes()) + ")";
            Wrappe wrappedMethod = mapping.getMethods().findWrappe(name);
            if (wrappedMethod != null && !Utils.isNullOrEmpty(wrappedMethod.getCppName())) {
                return wrappedMethod.getCppName();
            }
        }
        Java4CppWrappe annot = method.getAnnotation(Java4CppWrappe.class);
        if (annot != null && !Utils.isNullOrEmpty(annot.value())) {
            return annot.value();
        }
        return mappings.escapeName(method.getName());
    }
33578
public static void assertOneParameter(final Method method, Class<? extends Annotation> annotation)
   {
      if (method.getParameterTypes().length != 1)
      {
         throw annotation == null ? MESSAGES.methodHasToDeclareExactlyOneParameter(method) : MESSAGES.methodHasToDeclareExactlyOneParameter2(method, annotation);
      }
   }
583575
public String getMethodDescriptor(ExecutableType method) {
    StringBuilder sb = new StringBuilder("(");
    for (TypeMirror t : method.getParameterTypes()) {
      sb.append(getSignatureName(t));
    }
    sb.append(")");
    sb.append(getSignatureName(method.getReturnType()));
    return sb.toString();
  }