Author: alessio.soldano(a)jboss.com
Date: 2010-03-15 09:22:23 -0400 (Mon, 15 Mar 2010)
New Revision: 11782
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
Log:
Fix some warnings using generics
Modified: common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2010-03-15 13:20:12 UTC
(rev 11781)
+++ common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2010-03-15 13:22:23 UTC
(rev 11782)
@@ -134,6 +134,7 @@
}
}
+ @SuppressWarnings("deprecation")
private void setEntityResolver(DocumentBuilder builder)
{
EntityResolver entityResolver = null;
@@ -452,9 +453,9 @@
/** Get the attributes as Map<QName, String>
*/
- public static Map getAttributes(Element el)
+ public static Map<QName, String> getAttributes(Element el)
{
- Map attmap = new HashMap();
+ Map<QName, String> attmap = new HashMap<QName, String>();
NamedNodeMap attribs = el.getAttributes();
int len = attribs.getLength();
for (int i = 0; i < len; i++)
@@ -493,7 +494,7 @@
}
}
}
-
+
/** True if the node has text child elements only
*/
public static boolean hasTextChildNodesOnly(Node node)
@@ -609,7 +610,7 @@
private static Element getFirstChildElementIntern(Node node, QName nodeName, boolean
recursive)
{
Element childElement = null;
- Iterator it = getChildElementsIntern(node, nodeName, recursive);
+ Iterator<Element> it = getChildElementsIntern(node, nodeName, recursive);
if (it.hasNext())
{
childElement = (Element)it.next();
@@ -619,28 +620,28 @@
/** Gets the child elements for a given local name without namespace
*/
- public static Iterator getChildElements(Node node, String nodeName)
+ public static Iterator<Element> getChildElements(Node node, String nodeName)
{
return getChildElements(node, nodeName, false);
}
/** Gets the child elements for a given local name without namespace
*/
- public static Iterator getChildElements(Node node, String nodeName, boolean
recursive)
+ public static Iterator<Element> getChildElements(Node node, String nodeName,
boolean recursive)
{
return getChildElementsIntern(node, new QName(nodeName), recursive);
}
/** Gets the child element for a given qname
*/
- public static Iterator getChildElements(Node node, QName nodeName)
+ public static Iterator<Element> getChildElements(Node node, QName nodeName)
{
return getChildElements(node, nodeName, false);
}
/** Gets the child element for a given qname
*/
- public static Iterator getChildElements(Node node, QName nodeName, boolean recursive)
+ public static Iterator<Element> getChildElements(Node node, QName nodeName,
boolean recursive)
{
return getChildElementsIntern(node, nodeName, recursive);
}
@@ -719,7 +720,7 @@
}
}
- private static Iterator getChildElementsIntern(Node node, QName nodeName, boolean
recursive)
+ private static Iterator<Element> getChildElementsIntern(Node node, QName
nodeName, boolean recursive)
{
return getChildElementsAsListIntern(node, nodeName, recursive).iterator();
}