public final class SelectItemsIterator<T extends javax.faces.model.SelectItem>
extends java.lang.Object
implements java.util.Iterator<javax.faces.model.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 interface |
SelectItemsIterator.ComponentAwareSelectItemIterator<E> |
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 javax.faces.context.FacesContext |
ctx
The
FacesContext for the current request. |
private SelectItemsIterator.ComponentAwareSelectItemIterator<javax.faces.model.SelectItem> |
items
Iterator over the SelectItem elements pointed at by a
UISelectItems component, or null . |
private java.util.ListIterator<javax.faces.component.UIComponent> |
kids
Iterator over the children of the parent component.
|
private SelectItemsIterator.SingleElementIterator |
singleItemIterator
Expose single SelectItems via an Iterator.
|
Constructor and Description |
---|
SelectItemsIterator(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent parent)
Construct an iterator instance for the specified parent component.
|
Modifier and Type | Method and Description |
---|---|
javax.faces.component.UIComponent |
currentSelectComponent() |
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. |
javax.faces.model.SelectItem |
next()
Return the next element in the iteration.
|
void |
remove()
Throw UnsupportedOperationException.
|
private void |
updateSingeItemIterator(javax.faces.component.UIComponent selectComponent,
javax.faces.model.SelectItem item)
Update the
singleItemIterator with the provided
item |
private SelectItemsIterator.ComponentAwareSelectItemIterator<javax.faces.model.SelectItem> items
Iterator over the SelectItem elements pointed at by a
UISelectItems
component, or null
.
private java.util.ListIterator<javax.faces.component.UIComponent> kids
Iterator over the children of the parent component.
private SelectItemsIterator.SingleElementIterator singleItemIterator
private javax.faces.context.FacesContext ctx
FacesContext
for the current request.public SelectItemsIterator(javax.faces.context.FacesContext ctx, javax.faces.component.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<javax.faces.model.SelectItem>
public javax.faces.model.SelectItem next()
Return the next element in the iteration.
next
in interface java.util.Iterator<javax.faces.model.SelectItem>
java.util.NoSuchElementException
- if there are no more elementspublic javax.faces.component.UIComponent currentSelectComponent()
public void remove()
Throw UnsupportedOperationException.
remove
in interface java.util.Iterator<javax.faces.model.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(javax.faces.component.UIComponent selectComponent, javax.faces.model.SelectItem item)
singleItemIterator
with the provided
item
item
- the SelectItem
to expose as an IteratorCopyright © 2002-2013 Oracle America, Inc. All Rights Reserved.