Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.lang.reflect.Method;

public class Main {
    public static boolean isAccessor(Method method, String findValue) {
        boolean accessor = false;
        final Class<?>[] parameterTypes = method.getParameterTypes();
        final String methodName = method.getName();
        if (parameterTypes.length == 0 && method.getReturnType() != null
                && (methodName.startsWith("get") || methodName.startsWith("is"))
                && methodName.toLowerCase().indexOf(findValue.toLowerCase()) > -1) {
            accessor = true;
        }
        return accessor;
    }
}