org.codehaus.enunciate.contract.jaxb
Class ElementComparator

java.lang.Object
  extended by org.codehaus.enunciate.contract.jaxb.ElementComparator
All Implemented Interfaces:
java.util.Comparator<Element>

public class ElementComparator
extends java.lang.Object
implements java.util.Comparator<Element>

A comparator for accessors.

Author:
Ryan Heaton

Constructor Summary
ElementComparator(java.lang.String[] propOrder, javax.xml.bind.annotation.XmlAccessOrder order)
          Instantiate a new comparator, given the sorting parameters.
 
Method Summary
 int compare(Element accessor1, Element accessor2)
           
protected  int find(java.lang.String[] propOrder, java.lang.String propertyName)
          Finds the order index of the specified property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ElementComparator

public ElementComparator(java.lang.String[] propOrder,
                         javax.xml.bind.annotation.XmlAccessOrder order)
Instantiate a new comparator, given the sorting parameters.

Parameters:
propOrder - The property order, or null if none is specified.
order - The accessor order.
Method Detail

compare

public int compare(Element accessor1,
                   Element accessor2)
Specified by:
compare in interface java.util.Comparator<Element>

find

protected int find(java.lang.String[] propOrder,
                   java.lang.String propertyName)
Finds the order index of the specified property.

Parameters:
propOrder - The property order.
propertyName - The property name.
Returns:
The order index of the specified property, or -1 if not found.