是访问器方法
/**来 自 N o w J a v a . c o m**/ //package com.nowjava; import java.lang.reflect.Method; public class Main { public static final String[] ACCESSOR_PREFIXES = new String[] { "is", "get", "has" }; public static boolean isAccessor(Method method) { for (String prefix : ACCESSOR_PREFIXES) { if (method.getName().startsWith(prefix) && method.getParameterTypes().length == 0 && method.getReturnType() != null)