You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by or...@apache.org on 2005/09/02 18:23:45 UTC

svn commit: r267228 - /myfaces/api/trunk/src/java/javax/faces/component/_SelectItemsIterator.java

Author: oros
Date: Fri Sep  2 09:23:39 2005
New Revision: 267228

URL: http://svn.apache.org/viewcvs?rev=267228&view=rev
Log:
resolved dependency on impl (RenderUtils)

Modified:
    myfaces/api/trunk/src/java/javax/faces/component/_SelectItemsIterator.java

Modified: myfaces/api/trunk/src/java/javax/faces/component/_SelectItemsIterator.java
URL: http://svn.apache.org/viewcvs/myfaces/api/trunk/src/java/javax/faces/component/_SelectItemsIterator.java?rev=267228&r1=267227&r2=267228&view=diff
==============================================================================
--- myfaces/api/trunk/src/java/javax/faces/component/_SelectItemsIterator.java (original)
+++ myfaces/api/trunk/src/java/javax/faces/component/_SelectItemsIterator.java Fri Sep  2 09:23:39 2005
@@ -15,20 +15,10 @@
  */
 package javax.faces.component;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UISelectItem;
-import javax.faces.component.UISelectItems;
+import java.util.*;
 import javax.faces.el.ValueBinding;
 import javax.faces.model.SelectItem;
 
-import org.apache.myfaces.renderkit.RendererUtils;
 
 /**
  * @author Mathias Broekelmann (latest modification by $Author$)
@@ -76,7 +66,7 @@
                 throw new IllegalArgumentException(
                 _collectionLabel + " referenced by UISelectItems with binding '"
                 + binding.getExpressionString()
-                + "' and Component-Path : " + RendererUtils.getPathToComponent(_currentUISelectItems)
+                + "' and Component-Path : " + getPathToComponent(_currentUISelectItems)
                 + " does not contain Objects of type SelectItem");
             }
             return _nestedItems.next();
@@ -111,7 +101,7 @@
                                     "Value binding '"
                                     + (binding == null ? null : binding.getExpressionString())
                                     + "' of UISelectItem : "
-                                    + RendererUtils.getPathToComponent(child)
+                                    + getPathToComponent(child)
                                     + " does not reference an Object of type SelectItem");
                 }
                 return item;
@@ -163,7 +153,7 @@
                         + (binding == null ? null : binding
                                         .getExpressionString())
                         + "'of UISelectItems with component-path "
-                        + RendererUtils.getPathToComponent(child)
+                        + getPathToComponent(child)
                         + " does not reference an Object of type SelectItem, SelectItem[], Collection or Map but of type : "
                         + ((value == null) ? null : value
                                         .getClass()
@@ -184,4 +174,52 @@
         throw new UnsupportedOperationException();
     }
 
+
+    private String getPathToComponent(UIComponent component)
+    {
+        StringBuffer buf = new StringBuffer();
+
+        if(component == null)
+        {
+            buf.append("{Component-Path : ");
+            buf.append("[null]}");
+            return buf.toString();
+        }
+
+        getPathToComponent(component,buf);
+
+        buf.insert(0,"{Component-Path : ");
+        buf.append("}");
+
+        return buf.toString();
+    }
+
+    private void getPathToComponent(UIComponent component, StringBuffer buf)
+    {
+        if(component == null)
+            return;
+
+        StringBuffer intBuf = new StringBuffer();
+
+        intBuf.append("[Class: ");
+        intBuf.append(component.getClass().getName());
+        if(component instanceof UIViewRoot)
+        {
+            intBuf.append(",ViewId: ");
+            intBuf.append(((UIViewRoot) component).getViewId());
+        }
+        else
+        {
+            intBuf.append(",Id: ");
+            intBuf.append(component.getId());
+        }
+        intBuf.append("]");
+
+        buf.insert(0,intBuf);
+
+        if(component!=null)
+        {
+            getPathToComponent(component.getParent(),buf);
+        }
+    }
 }