| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| AttributeNameComparator |
|
| 3.0;3 |
| 1 | package com.aurea.maven.plugins.sonic.utils.xmlsorter; | |
| 2 | ||
| 3 | import java.util.Comparator; | |
| 4 | ||
| 5 | import org.codehaus.plexus.util.xml.Xpp3Dom; | |
| 6 | ||
| 7 | /** | |
| 8 | * @author Jamie | |
| 9 | */ | |
| 10 | 0 | public class AttributeNameComparator implements Comparator<Xpp3Dom> { |
| 11 | ||
| 12 | ||
| 13 | /** | |
| 14 | * compares two Xpp3Dom nodes based on the value of their attributes called "name". | |
| 15 | */ | |
| 16 | public int compare(final Xpp3Dom arg0, final Xpp3Dom arg1) { | |
| 17 | ||
| 18 | 0 | if (arg0.getAttribute("name") != null) { |
| 19 | 0 | return arg0.getAttribute("name").compareTo(arg1.getAttribute("name")); |
| 20 | } | |
| 21 | 0 | return 0; |
| 22 | } | |
| 23 | ||
| 24 | } |