Java Reflection Method Name getMethodName(Method method)

Here you can find the source of getMethodName(Method method)

Description

get Method Name

License

Open Source License

Declaration

protected static String getMethodName(Method method) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2008 The University of York.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * //from w w w. j  a  v a2  s.com
 * Contributors:
 *     Dimitrios Kolovos - initial API and implementation
 ******************************************************************************/

import java.lang.reflect.Method;

public class Main {
    protected static String getMethodName(Method method) {
        String methodName = method.getName();
        if (methodName.startsWith("_"))
            methodName = methodName.substring(1);
        return methodName;
    }
}

Related

  1. getMethodInternal(Class clazz, String methodName)
  2. getMethodName()
  3. getMethodName()
  4. getMethodName(final int depth)
  5. getMethodName(Method method)
  6. getMethodName(Method method)
  7. getMethodName(Method method, boolean useSegment, String segment, String value)
  8. getMethodName(String prefix, String fieldName)
  9. getMethodNameAndDescriptor(Method m)