&& Modifier.isTransient(field.getModifiers())) {
continue;
}
try {
FieldHandle fieldSerializer = new FieldHandle();
fieldSerializer.setPropertyName(propertyName);
fieldSerializer.setMethod(method);
fieldList.add(fieldSerializer);
appendPair(propertyName, method.invoke(obj));
sb.append(SEPARATOR);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
} else if (methodName.startsWith("is")) { // 取is方法的返回值
if (methodName.length() < 3
|| !Character.isUpperCase(methodName.charAt(2))) {
continue;
}
String propertyName = Character.toLowerCase(methodName
.charAt(2))
+ methodName.substring(3);
Field field = null;
try {
field = clazz.getDeclaredField(propertyName);
} catch (SecurityException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
if (field != null
&& Modifier.isTransient(field.getModifiers())) {
continue;
}
try {
FieldHandle fieldSerializer = new FieldHandle();
fieldSerializer.setPropertyName(propertyName);
fieldSerializer.setMethod(method);
fieldList.add(fieldSerializer);
appendPair(propertyName, method.invoke(obj));
sb.append(SEPARATOR);
} catch (IllegalArgumentException e) {