Here you can find the source of getSetterName(Method m)
Parameter | Description |
---|---|
m | Method object. |
private static String getSetterName(Method m)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { /**/*from w w w. ja v a 2s . c om*/ * Get setter name. "setName" -> "name" * * @param m Method object. * @return Property name of this setter. */ private static String getSetterName(Method m) { String name = m.getName(); if (name.startsWith("set") && (name.length() >= 4) && m.getReturnType().equals(void.class) && (m.getParameterTypes().length == 1)) { return Character.toLowerCase(name.charAt(3)) + name.substring(4); } return null; } }