| protected List<String> getFieldOrder() Overrides com.sun.jna.Structure.getFieldOrder.
Doc from com.sun.jna.Structure.getFieldOrder.
Returns this Structure's field names in their proper order.
When defining a new Structure you shouldn't override this
method, but use FieldOrder annotation to define your field
order(this also works with inheritance)
If you want to do something non-standard you can override the method
and define it as followed
protected List getFieldOrder() {
return Arrays.asList(...);
}
Important Note
When deriving from an existing Structure subclass, ensure that
you augment the list provided by the superclass, e.g.
protected List getFieldOrder() {
List fields = new LinkedList(super.getFieldOrder());
fields.addAll(Arrays.asList(...));
return fields;
}
Field order must be explicitly indicated, since the
field order as returned by Class#getFields() is not
guaranteed to be predictable.
- Returns:List<String>
ordered list of field names
- Annotations
- @Override
|