如果给定的方法对象对应于setter,则返回true。
/** * A utility class that performs various operations using the Java reflection * API. * * @author Yanick Duchesne * <dl> * <dt><b>Copyright: </b> * <dd>Copyright © 2002-2003 <a * href="http://www.sapia-oss.org">Sapia Open Source Software </a>. All * Rights Reserved.</dd> * </dt> * <dt><b>License: </b> * <dd>Read the license.txt file of the jar or visit the <a * href="http://www.sapia-oss.org/license.html">license page </a> at the * Sapia OSS web site</dd> * </dt> * </dl> */ //package com.nowjava; import java.lang.reflect.Method; import java.lang.reflect.Modifier; /* 时 代 Java - nowjava.com 提 供 */ public class Main { /** * Returns <code>true</code> if the given method object corresponds to a * setter. The method must start with a "set" prefix and be non-static, * public, and take a single parameter. * * @param method * a <code>Method</code> object. * @return <code>true</code> if the given instance corresponds to a setter. */ public static boolean isSetter(Method method) {