Package com.sun.jna

Annotation Type Structure.FieldOrder


  • @Documented
    @Retention(RUNTIME)
    @Target(TYPE)
    public static @interface Structure.FieldOrder
    Used to declare fields order as metadata instead of method. example:
    
     // New
     @FieldOrder({ "n", "s" })
     class Parent extends Structure {
         public int n;
         public String s;
     }
     @FieldOrder({ "d", "c" })
     class Son extends Parent {
         public double d;
         public char c;
     }
     // Old
     class Parent extends Structure {
         public int n;
         public String s;
         protected List getFieldOrder() {
             return Arrays.asList("n", "s");
         }
     }
     class Son extends Parent {
         public double d;
         public char c;
         protected List getFieldOrder() {
             List fields = new LinkedList(super.getFieldOrder());
             fields.addAll(Arrays.asList("d", "c"));
             return fields;
         }
     }
     
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String[] value