Annotation Type Order


  • @Retention(RUNTIME)
    public @interface Order
    The Order annotation is used to specify the order of appearance of XML elements and attributes. When used it ensures that on serialization the XML generated is predictable. By default serialization of fields is done in declaration order.
    Author:
    Niall Gallagher
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String[] attributes
      Specifies the appearance order of the XML attributes within the generated document.
      java.lang.String[] elements
      Specifies the appearance order of the XML elements within the generated document.
    • Element Detail

      • elements

        java.lang.String[] elements
        Specifies the appearance order of the XML elements within the generated document. This overrides the default order used, which is the declaration order within the class. If an element is not specified within this array then its order will be the appearance order directly after the last specified element.
        Returns:
        an ordered array of elements representing order
        Default:
        {}
      • attributes

        java.lang.String[] attributes
        Specifies the appearance order of the XML attributes within the generated document. This overrides the default order used, which is the declaration order within the class. If an attribute is not specified within this array then its order will be the appearance order directly after the last specified attribute.
        Returns:
        an ordered array of attributes representing order
        Default:
        {}