Package com.illumon.util
Class XmlUtils
java.lang.Object
com.illumon.util.XmlUtils
A couple of static methods to compare
Document
s, Element
s and Content
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
deepEquals
(List<org.jdom2.Attribute> attributes1, List<org.jdom2.Attribute> attributes2) Check if two attribute sets are equal.static boolean
deepEquals
(org.jdom2.Content content1, org.jdom2.Content content2) Check if two different content elements are equal.static boolean
deepEquals
(org.jdom2.Document document1, org.jdom2.Document document2) Perform a deep equals operation across two documents.static boolean
deepEquals
(org.jdom2.Element element1, org.jdom2.Element element2) Check if twoElement
s are equal, comparing all attributes and values.
-
Constructor Details
-
XmlUtils
public XmlUtils()
-
-
Method Details
-
deepEquals
public static boolean deepEquals(@Nullable org.jdom2.Document document1, @Nullable org.jdom2.Document document2) Perform a deep equals operation across two documents.- Parameters:
document1
- The first document to comparedocument2
- The second document to compare.- Returns:
- true if they are equal
-
deepEquals
public static boolean deepEquals(@Nullable org.jdom2.Content content1, @Nullable org.jdom2.Content content2) Check if two different content elements are equal.- Parameters:
content1
- the first content elementcontent2
- the second content element- Returns:
- true if the items are equal
-
deepEquals
public static boolean deepEquals(@Nullable org.jdom2.Element element1, @Nullable org.jdom2.Element element2) Check if twoElement
s are equal, comparing all attributes and values.- Parameters:
element1
- the first element to compareelement2
- the second element to compare- Returns:
- true if they are equal
-
deepEquals
public static boolean deepEquals(@NotNull List<org.jdom2.Attribute> attributes1, @NotNull List<org.jdom2.Attribute> attributes2) Check if two attribute sets are equal. Note that equivalent is not equal, in other words the order of the attributes must also be equal between the two elements for them to be deepEqual- Parameters:
attributes1
- the first attribute list to compareattributes2
- the second attribute list to compare.- Returns:
- true if the two attribute sets are equal.
-