final class SelectItemsIterator extends java.lang.Object implements java.util.Iterator<SelectItem>
Package private class for iterating over the set of SelectItem
s
for a parent UISelectMany
or UISelectOne
.
Modifier and Type | Class and Description |
---|---|
private static class |
SelectItemsIterator.ArrayIterator
Handles arrays of
SelectItem s, generic Objects,
or combintations of both. |
private static class |
SelectItemsIterator.GenericObjectSelectItemIterator
Base class to support iterating over Collections or Arrays that may
or may not contain
SelectItem instances. |
private static class |
SelectItemsIterator.IterableItemIterator
Handles Collections of
SelectItem s, generic Objects,
or combintations of both. |
private static class |
SelectItemsIterator.MapIterator
Iterates over a
Map of values exposing each entry as a SelectItem. |
private static class |
SelectItemsIterator.SingleElementIterator
Exposes single
SelectItem instances as an Iterator. |
Modifier and Type | Field and Description |
---|---|
private FacesContext |
ctx
The
FacesContext for the current request. |
private java.util.Iterator<SelectItem> |
items
Iterator over the SelectItem elements pointed at by a
UISelectItems component, or null . |
private java.util.ListIterator<UIComponent> |
kids
Iterator over the children of the parent component.
|
private SelectItemsIterator.SingleElementIterator |
singleItemIterator
Expose single SelectItems via an Iterator.
|
Constructor and Description |
---|
SelectItemsIterator(FacesContext ctx,
UIComponent parent)
Construct an iterator instance for the specified parent component.
|
Modifier and Type | Method and Description |
---|---|
private java.lang.Object |
findNextValidChild() |
boolean |
hasNext()
Return
true if the iteration has more elements. |
private void |
initializeItems(java.lang.Object kid)
Initializes the
items instance variable with an
Iterator appropriate to the UISelectItem(s) value. |
SelectItem |
next()
Return the next element in the iteration.
|
void |
remove()
Throw UnsupportedOperationException.
|
private void |
updateSingeItemIterator(SelectItem item)
Update the
singleItemIterator with the provided
item |
private java.util.Iterator<SelectItem> items
Iterator over the SelectItem elements pointed at by a
UISelectItems
component, or null
.
private java.util.ListIterator<UIComponent> kids
Iterator over the children of the parent component.
private SelectItemsIterator.SingleElementIterator singleItemIterator
private FacesContext ctx
FacesContext
for the current request.public SelectItemsIterator(FacesContext ctx, UIComponent parent)
Construct an iterator instance for the specified parent component.
ctx
- the FacesContext
for the current requestparent
- The parent UIComponent
whose children will be
processedpublic boolean hasNext()
Return true
if the iteration has more elements.
hasNext
in interface java.util.Iterator<SelectItem>
public SelectItem next()
Return the next element in the iteration.
next
in interface java.util.Iterator<SelectItem>
java.util.NoSuchElementException
- if there are no more elementspublic void remove()
Throw UnsupportedOperationException.
remove
in interface java.util.Iterator<SelectItem>
private void initializeItems(java.lang.Object kid)
Initializes the items
instance variable with an
Iterator
appropriate to the UISelectItem(s) value.
private java.lang.Object findNextValidChild()
private void updateSingeItemIterator(SelectItem item)
singleItemIterator
with the provided
item
item
- the SelectItem
to expose as an Iterator