| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | Map mapData = new HashMap<>(); |
| | | for (int i = 0, n = propertyDescriptors.length; i <n ; i++) { |
| | | PropertyDescriptor descriptor = propertyDescriptors[i]; |
| | | String propertyName = descriptor.getName(); |
| | |
| | | |
| | | if (result != null) { |
| | | if ("data".equals(propertyName)){ |
| | | if(existFild == null){ |
| | | returnMap.putAll((Map) result); |
| | | }else{ |
| | | Map resulMap = (Map) result; |
| | | for (Object o : resulMap.keySet()) { |
| | | if(existFild.contains(o)){ |
| | | returnMap.put(o,resulMap.get(o)); |
| | | } |
| | | } |
| | | } |
| | | mapData = (Map) result; |
| | | }else if(existFild.contains((fieldMap.containsKey(propertyName)?fieldMap.get(propertyName):propertyName).toLowerCase())){ |
| | | returnMap.put(fieldMap.containsKey(propertyName)?fieldMap.get(propertyName):propertyName, result); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | //作用主要用于已MAP中的数据为准,bean里面遇到字段相同也会进行覆盖。 |
| | | if(existFild == null){ |
| | | returnMap.putAll((Map) mapData); |
| | | }else{ |
| | | Map resulMapChild = (Map) mapData; |
| | | for (Object o : resulMapChild.keySet()) { |
| | | if(existFild.contains(String.valueOf(o).toLowerCase())){ |
| | | returnMap.put(String.valueOf(o).toLowerCase(),resulMapChild.get(o)); |
| | | } |
| | | } |
| | | } |
| | | return returnMap; |
| | | } |
| | | |