Skip navigation links
JNA API 5.6.0
com.sun.jna

Annotation Type Structure.FieldOrder



  • @Documented
     @Retention(value=RUNTIME)
     @Target(value=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 and Description
      java.lang.String[] value 
    • Element Detail

      • value

        public abstract java.lang.String[] value
JNA API 5.6.0

Copyright © 2007-2018 Timothy Wall. All Rights Reserved.