返回给定属性名称的is getter方法名称。
//n o w j a v a . c o m - 时代Java //package com.nowjava; public class Main { /** * Return the is getter method name for the given property name. * * @param property the property name * @return the is getter method name for the given property name. */ public static String toIsGetterName(String property) { StringBuilder buffer = new StringBuilder(property.length() + 3); buffer.append("is"); buffer.append(Character.toUpperCase(property.charAt(0))); buffer.append(property.substring(1)); return buffer.toString(); } }