[portal-commits] JBoss Portal SVN: r8982 - modules/common/trunk/common/src/main/java/org/jboss/portal/common/xml.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Sat Nov 17 06:26:11 EST 2007


Author: julien at jboss.com
Date: 2007-11-17 06:26:11 -0500 (Sat, 17 Nov 2007)
New Revision: 8982

Modified:
   modules/common/trunk/common/src/main/java/org/jboss/portal/common/xml/XMLTools.java
Log:
Generified XMLTools

Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/xml/XMLTools.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/xml/XMLTools.java	2007-11-17 11:19:42 UTC (rev 8981)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/xml/XMLTools.java	2007-11-17 11:26:11 UTC (rev 8982)
@@ -358,7 +358,7 @@
     * @return an iterator for the designated elements
     * @throws IllegalArgumentException if the element is null or the name is null
     */
-   public static Iterator getChildrenIterator(Element element, String name) throws IllegalArgumentException
+   public static Iterator<Element> getChildrenIterator(Element element, String name) throws IllegalArgumentException
    {
       return getChildren(element, name).iterator();
    }
@@ -373,7 +373,7 @@
     * @return an iterator for the designated elements
     * @throws IllegalArgumentException if the element is null or the name is null
     */
-   public static Iterator getChildrenIterator(Element element, String uri, String name) throws IllegalArgumentException
+   public static Iterator<Element> getChildrenIterator(Element element, String uri, String name) throws IllegalArgumentException
    {
       return getChildren(element, uri, name).iterator();
    }
@@ -386,7 +386,7 @@
     * @return a list of elements
     * @throws IllegalArgumentException if the element is null or the name is null
     */
-   public static List getChildren(Element element, String name) throws IllegalArgumentException
+   public static List<Element> getChildren(Element element, String name) throws IllegalArgumentException
    {
       return getChildren(element, null, name);
    }
@@ -401,7 +401,7 @@
     * @return a list of elements
     * @throws IllegalArgumentException if the element is null or the name is null
     */
-   public static List getChildren(Element element, String uri, String name) throws IllegalArgumentException
+   public static List<Element> getChildren(Element element, String uri, String name) throws IllegalArgumentException
    {
       if (element == null)
       {
@@ -411,7 +411,7 @@
       {
          throw new IllegalArgumentException("No name specified");
       }
-      ArrayList result = new ArrayList();
+      ArrayList<Element> result = new ArrayList<Element>();
       NodeList list = element.getChildNodes();
       for (int i = 0; i < list.getLength(); i++)
       {
@@ -447,9 +447,9 @@
          throw new IllegalArgumentException();
       }
       Properties props = new Properties();
-      for (Iterator i = getChildren(propertiesElt, "entry").iterator(); i.hasNext();)
+      for (Object o : getChildren(propertiesElt, "entry"))
       {
-         Element entryElt = (Element)i.next();
+         Element entryElt = (Element)o;
          String key = entryElt.getAttribute("key");
          String value = asString(entryElt);
          props.put(key, value);




More information about the portal-commits mailing list