// Path: sorter/src/main/java/sortpom/util/XmlOrderedResult.java
// public final class XmlOrderedResult {
//     private final boolean ordered;
//     private final String errorMessage;
// 
//     private XmlOrderedResult(boolean ordered, String errorMessage) {
//         this.ordered = ordered;
//         this.errorMessage = errorMessage;
//     }
// 
//     /** pom file was ordered */
//     public static XmlOrderedResult ordered() {
//         return new XmlOrderedResult(true, "");
//     }
// 
//     /** The xml elements was not in the right order */
//     public static XmlOrderedResult nameDiffers(String originalElementName, String newElementName) {
//         return new XmlOrderedResult(false, String.format("The xml element <%s> should be placed before <%s>",
//                 newElementName, originalElementName));
//     }
// 
//     /** The child elements of two elements differ. Example: When dependencies should be sorted */
//     public static XmlOrderedResult childElementDiffers(String name, int originalSize, int newSize) {
//         return new XmlOrderedResult(false, String.format(
//                 "The xml element <%s> with %s child elements should be placed before element <%s> with %s child elements",
//                 name, newSize, name, originalSize));
//     }
// 
//     /** The texts inside two elements differ. Example: when maven properties should be sorted */
//     public static XmlOrderedResult textContentDiffers(String name, String originalElementText, String newElementText) {
//         return new XmlOrderedResult(false, String.format("The xml element <%s>%s</%s> should be placed before <%s>%s</%s>",
//                 name, newElementText, name, name, originalElementText, name));
//     }
// 
//     public static XmlOrderedResult lineDiffers(int lineNumber, String sortedXmlLine) {
//         return new XmlOrderedResult(false, String.format("The line %d is not considered sorted, should be %s",
//                 lineNumber, sortedXmlLine));
//     }
// 
//     public static XmlOrderedResult lineSeparatorCharactersDiffer() {
//         return new XmlOrderedResult(false, "The line separator characters differ from sorted pom");
//     }
// 
//     /** Returns true when verification tells that the pom file was sorted */
//     public boolean isOrdered() {
//         return ordered;
//     }
// 
//     /** An error message that describes what went wrong with the verification operation */
//     public String getErrorMessage() {
//         return errorMessage;
//     }
// 
// }


import org.jdom.Element;
import sortpom.util.XmlOrderedResult;
import java.util.List;
package sortpom.verify;



/**
 * @author bjorn
 * @since 2012-07-01
 */
public class ElementComparator {
    private final Element originalElement;
    private final Element newElement;

    public ElementComparator(Element originalElement, Element newElement) {
        this.originalElement = originalElement;
        this.newElement = newElement;
    }

// Path: sorter/src/main/java/sortpom/util/XmlOrderedResult.java
// public final class XmlOrderedResult {
//     private final boolean ordered;
//     private final String errorMessage;
// 
//     private XmlOrderedResult(boolean ordered, String errorMessage) {
//         this.ordered = ordered;
//         this.errorMessage = errorMessage;
//     }
// 
//     /** pom file was ordered */
//     public static XmlOrderedResult ordered() {
//         return new XmlOrderedResult(true, "");
//     }
// 
//     /** The xml elements was not in the right order */
//     public static XmlOrderedResult nameDiffers(String originalElementName, String newElementName) {
//         return new XmlOrderedResult(false, String.format("The xml element <%s> should be placed before <%s>",
//                 newElementName, originalElementName));
//     }
// 
//     /** The child elements of two elements differ. Example: When dependencies should be sorted */
//     public static XmlOrderedResult childElementDiffers(String name, int originalSize, int newSize) {
//         return new XmlOrderedResult(false, String.format(
//                 "The xml element <%s> with %s child elements should be placed before element <%s> with %s child elements",
//                 name, newSize, name, originalSize));
//     }
// 
//     /** The texts inside two elements differ. Example: when maven properties should be sorted */
//     public static XmlOrderedResult textContentDiffers(String name, String originalElementText, String newElementText) {
//         return new XmlOrderedResult(false, String.format("The xml element <%s>%s</%s> should be placed before <%s>%s</%s>",
//                 name, newElementText, name, name, originalElementText, name));
//     }
// 
//     public static XmlOrderedResult lineDiffers(int lineNumber, String sortedXmlLine) {
//         return new XmlOrderedResult(false, String.format("The line %d is not considered sorted, should be %s",
//                 lineNumber, sortedXmlLine));
//     }
// 
//     public static XmlOrderedResult lineSeparatorCharactersDiffer() {
//         return new XmlOrderedResult(false, "The line separator characters differ from sorted pom");
//     }
// 
//     /** Returns true when verification tells that the pom file was sorted */
//     public boolean isOrdered() {
//         return ordered;
//     }
// 
//     /** An error message that describes what went wrong with the verification operation */
//     public String getErrorMessage() {
//         return errorMessage;
//     }
// 
// }


// Path: sorter/src/main/java/sortpom/verify/ElementComparator.java
import org.jdom.Element;
import sortpom.util.XmlOrderedResult;
import java.util.List;

package sortpom.verify;



/**
 * @author bjorn
 * @since 2012-07-01
 */
public class ElementComparator {
    private final Element originalElement;
    private final Element newElement;

    public ElementComparator(Element originalElement, Element newElement) {
        this.originalElement = originalElement;
        this.newElement = newElement;
    }

    public XmlOrderedResult isElementOrdered() {