Commit c0a57e04 authored by p x's avatar p x
Browse files

1

parent f92c773b
......@@ -510,22 +510,23 @@ public class Parse {
// public static void convoterBean( Object source , Object target) throws IllegalArgumentException, IllegalAccessException, ClassNotFoundException, InstantiationException, NoSuchFieldException, SecurityException {
public static void convoterBean(Object source, Object target) {
Field[] fields = source.getClass().getDeclaredFields();
Field tField = null;
try {
Field[] fields = source.getClass().getDeclaredFields();
// List<Field> fList = new ArrayList<>();
List<Field> fList = Arrays.asList(fields);
List<Field> fList = Arrays.asList(fields);
// for (Field field : fields) {
// if (field.isAnnotationPresent(Order.class)) {
// fList.add(field);
// }
// }
Collections.sort(fList, new Comparator<Field>() {
@Override
public int compare(Field f1, Field f2) {
return f1.getAnnotation(Order.class).value() - f2.getAnnotation(Order.class).value();
}
});
Field tField = null;
try {
Collections.sort(fList, new Comparator<Field>() {
@Override
public int compare(Field f1, Field f2) {
return f1.getAnnotation(Order.class).value() - f2.getAnnotation(Order.class).value();
}
});
// Field[] fields = source.getClass().getDeclaredFields();
//获取目标对象指定的属性
//List<Field> fList = new ArrayList<>();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment