public static String getBeanFunName(Property property) {
try {
Method declaredMethod = property.getClass().getDeclaredMethod("writeReplace");
declaredMethod.setAccessible(Boolean.TRUE);
SerializedLambda serializedLambda = (SerializedLambda) declaredMethod.invoke(property);
String method = serializedLambda.getImplMethodName();
String attr;
if (method.startsWith("get")) {
attr = (char) (method.charAt(3) + 32) + method.substring(4);
} else if (method.startsWith("is")) {
attr = (char) (method.charAt(2) + 32) + method.substring(3);
} else {
throw new IllegalStateException("无法处理的方法名" + method);
}
return attr;
} catch (ReflectiveOperationException e) {
throw new RuntimeException(e);
}
}
public interface Property extends Function, Serializable {
}