/*
 * Order.java July 2006
 *
 * Copyright (C) 2006, Niall Gallagher <niallg@users.sf.net>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General 
 * Public License along with this library; if not, write to the 
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
 * Boston, MA  02111-1307  USA
 */

package org.simpleframework.xml;

import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Retention;

/**
 * The <code>Order</code> 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 appearance order. 
 * 
 * @author Niall Gallagher
 */
@Retention(RetentionPolicy.RUNTIME)
public @interface Order {

   /**
    * Specifies the appearance order of the XML elements within the
    * generated document. This overrides the default order used 
    * which is the order of appearance within the class. If an 
    * element is not specified then its order will be appearance
    * order directly after the last specified element.
    * 
    * @return an ordered array of elements representing order
    */
   public String[] elements() default {};
   
   /**
    * Specifies the appearance order of the attributes within the
    * generated document. This overrides the default order used 
    * which is the order of appearance within the class. If an 
    * attribute is not specified then its order will be appearance
    * order directly after the last specified attribute.
    * 
    * @return an ordered array of attributes representing order
    */
   public String[] attributes() default {};
}
@@ -1155,26 +1155,27 @@
 done in 
-appearance
+declaration
  order. 
@@ -1412,32 +1412,33 @@
 fault order used
+,
  %0D%0A    * which i
@@ -1443,35 +1443,33 @@
  is the 
-order of appearance
+declaration order
  within 
@@ -1489,40 +1489,58 @@
  an 
-%0D%0A    * element is not specified
+element %0D%0A    * is not specified within this array
  the
@@ -1550,32 +1550,43 @@
 ts order will be
+ the%0D%0A    *
  appearance%0D%0A   
@@ -1572,39 +1572,32 @@
     * appearance
-%0D%0A    *
  order directly 
@@ -1810,16 +1810,20 @@
  of the 
+XML 
 attribut
@@ -1828,34 +1828,35 @@
 utes within 
-the
 %0D%0A    *
+ the
  generated d
@@ -1901,16 +1901,17 @@
 der used
+,
  %0D%0A    *
@@ -1928,27 +1928,25 @@
 the 
-order of appearance
+declaration order
  wit
@@ -1966,24 +1966,16 @@
 . If an 
-%0D%0A    * 
 attribut
@@ -1976,16 +1976,24 @@
 tribute 
+%0D%0A    * 
 is not s
@@ -2001,16 +2001,34 @@
 ecified 
+within this array 
 then its
@@ -2041,16 +2041,27 @@
  will be
+ the%0D%0A    *
  appeara
@@ -2063,23 +2063,16 @@
 pearance
-%0D%0A    *
  order d

Update order annotation