提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.module.data.video.hikvision.utils; |
H |
2 |
|
|
3 |
import com.sun.jna.Structure; |
|
4 |
|
|
5 |
import java.lang.reflect.Field; |
|
6 |
import java.lang.reflect.Modifier; |
|
7 |
import java.util.ArrayList; |
|
8 |
import java.util.List; |
|
9 |
|
|
10 |
public class HIKSDKStructure extends Structure { |
|
11 |
protected List<String> getFieldOrder() { |
|
12 |
List<String> fieldOrderList = new ArrayList<String>(); |
|
13 |
for (Class<?> cls = getClass(); !cls.equals(HIKSDKStructure.class); cls = cls.getSuperclass()) { |
|
14 |
Field[] fields = cls.getDeclaredFields(); |
|
15 |
int modifiers; |
|
16 |
for (Field field : fields) { |
|
17 |
modifiers = field.getModifiers(); |
|
18 |
if (Modifier.isStatic(modifiers) || !Modifier.isPublic(modifiers)) { |
|
19 |
continue; |
|
20 |
} |
|
21 |
fieldOrderList.add(field.getName()); |
|
22 |
} |
|
23 |
} |
|
24 |
return fieldOrderList; |
|
25 |
} |
|
26 |
} |