Coverage Report - org.simpleframework.xml.Order
 
Classes in this File Line Coverage Branch Coverage Complexity
Order
N/A
N/A
0
 
 1  
 /*
 2  
  * Order.java November 2007
 3  
  *
 4  
  * Copyright (C) 2007, Niall Gallagher <niallg@users.sf.net>
 5  
  *
 6  
  * Licensed under the Apache License, Version 2.0 (the "License");
 7  
  * you may not use this file except in compliance with the License.
 8  
  * You may obtain a copy of the License at
 9  
  *
 10  
  *     http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
 15  
  * implied. See the License for the specific language governing 
 16  
  * permissions and limitations under the License.
 17  
  */
 18  
 
 19  
 package org.simpleframework.xml;
 20  
 
 21  
 import java.lang.annotation.RetentionPolicy;
 22  
 import java.lang.annotation.Retention;
 23  
 
 24  
 /**
 25  
  * The <code>Order</code> annotation is used to specify the order of
 26  
  * appearance of XML elements and attributes. When used it ensures 
 27  
  * that on serialization the XML generated is predictable. By default
 28  
  * serialization of fields is done in declaration order. 
 29  
  * 
 30  
  * @author Niall Gallagher
 31  
  */
 32  
 @Retention(RetentionPolicy.RUNTIME)
 33  
 public @interface Order {
 34  
 
 35  
    /**
 36  
     * Specifies the appearance order of the XML elements within the
 37  
     * generated document. This overrides the default order used, 
 38  
     * which is the declaration order within the class. If an element 
 39  
     * is not specified within this array then its order will be the
 40  
     * appearance order directly after the last specified element.
 41  
     * 
 42  
     * @return an ordered array of elements representing order
 43  
     */
 44  
    String[] elements() default {};
 45  
    
 46  
    /**
 47  
     * Specifies the appearance order of the XML attributes within 
 48  
     * the generated document. This overrides the default order used, 
 49  
     * which is the declaration order within the class. If an attribute 
 50  
     * is not specified within this array then its order will be the
 51  
     * appearance order directly after the last specified attribute.
 52  
     * 
 53  
     * @return an ordered array of attributes representing order
 54  
     */
 55  
    String[] attributes() default {};
 56  
 }