com.abra.j2xb.annotations
Annotation Type MOCollectionSort


@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface MOCollectionSort

Defines the ordering of a collection of Beans.

This annotation can only be used with a collection of beans or collection of atoms. It defines that the collection be sorted before writing the collection to XML (the sorting happens only before writing, and will not alter the original collection).

For a collection of beans, the collection is sorted by the attribute indicated in sortByProperty() and the sort order is indicated in sortDirection() member.

For a collection of atoms, the sortByProperty() value is ignored, and the sorting is using the native ordering of the atoms. the sort order is indicated in sortDirection() member.

For more advanced sorting options (such as multi-column sorting) use the @MOCollectionCustomSort() annotation.

Since:
JDK1.5
Version:
1.0, May 1, 2008
Author:
Yoav Abrahami
See Also:
MOProperty, MOCollectionCustomSort

Optional Element Summary
 java.lang.String sortByProperty
          The name of a Bean property to sort the collection by.
 MOCollectionSort.SortDirection sortDirection
          Indicates the direction of sorting - ascending or descending.
 

sortByProperty

public abstract java.lang.String sortByProperty
The name of a Bean property to sort the collection by. Ignored for a collection of atoms.

Default:
""

sortDirection

public abstract MOCollectionSort.SortDirection sortDirection
Indicates the direction of sorting - ascending or descending.

Default:
asc


Copyright © 2008. All Rights Reserved.