Package org.pepsoft.util
Class XMLUtils
java.lang.Object
org.pepsoft.util.XMLUtils
Utility methods for working with XML APIs.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends Exception>
voidforEachElement(NodeList nodeList, XMLUtils.ElementVisitor<E> visitor) Visit each element in a node list.
-
Method Details
-
forEachElement
public static <E extends Exception> void forEachElement(NodeList nodeList, XMLUtils.ElementVisitor<E> visitor) throws E Visit each element in a node list. This method assumes that every node is anElement, otherwise it will throw aClassCastException.- Parameters:
nodeList- The node list over which to iterate.visitor- The visitor to invoke for each element on the node list.- Throws:
ClassCastException- If not all nodes on the list are anElement.E- If the visitor throws a checked exception of the specified or inferred type.
-