Java Reflection Method Name getMethodName(Method method, boolean useSegment, String segment, String value)

Here you can find the source of getMethodName(Method method, boolean useSegment, String segment, String value)

Description

get Method Name

License

Open Source License

Declaration

protected static String getMethodName(Method method, boolean useSegment, String segment, String value) 

Method Source Code

//package com.java2s;
/******************************************************************************
 * Copyright (c) 2016 TypeFox and others.
 * /*from w ww  .  j  av a 2  s. c  o m*/
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0,
 * or the Eclipse Distribution License v. 1.0 which is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 * 
 * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
 ******************************************************************************/

import java.lang.reflect.Method;

public class Main {
    protected static String getMethodName(Method method, boolean useSegment, String segment, String value) {
        String name = value != null && value.length() > 0 ? value : method.getName();
        return useSegment ? segment + name : name;
    }
}

Related

  1. getMethodName()
  2. getMethodName(final int depth)
  3. getMethodName(Method method)
  4. getMethodName(Method method)
  5. getMethodName(Method method)
  6. getMethodName(String prefix, String fieldName)
  7. getMethodNameAndDescriptor(Method m)
  8. getMethodNameList(Class theClass)
  9. getMethodNameMinusGet(Method aMethod)