Top Description Inners Fields Constructors Methods
jakarta.faces.component

pack-priv final Class SelectItemsIterator

extends Object
implements Iterator<SelectItem>
Class Inheritance
All Implemented Interfaces
java.util.Iterator
Imports
java.io.IOException, .NotSerializableException, .ObjectInputStream, .ObjectOutputStream, java.lang.reflect.Array, java.util.Iterator, .ListIterator, .Map, .NoSuchElementException, jakarta.el.ValueExpression, jakarta.faces.context.FacesContext, jakarta.faces.model.SelectItem

Package private class for iterating over the set of SelectItems for a parent UISelectMany or UISelectOne.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
SelectItemsIterator.ArrayIterator

Handles arrays of SelectItems, generic Objects, or combintations of both.

private abstract 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 SelectItems, 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.

Field Summary

Modifier and TypeField and Description
private FacesContext
ctx

The FacesContext for the current request.

private Iterator<SelectItem>
items

Iterator over the SelectItem elements pointed at by a UISelectItems component, or null.

private ListIterator<UIComponent>
kids

Iterator over the children of the parent component.

private SelectItemsIterator.SingleElementIterator
singleItemIterator

Expose single SelectItems via an Iterator.

Constructor Summary

AccessConstructor and Description
public
SelectItemsIterator(FacesContext
the FacesContext for the current request
ctx
,
UIComponent
The parent UIComponent whose children will be processed
parent
)

Construct an iterator instance for the specified parent component.

Method Summary

Modifier and TypeMethod and Description
private Object

Returns:

the next valid child for processing
findNextValidChild
()

public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Return true if the iteration has more elements.

private void
initializeItems(Object kid)

Initializes the items instance variable with an Iterator appropriate to the UISelectItem(s) value.

public SelectItem
next()

Implements java.util.Iterator.next.

Return the next element in the iteration.

public void
remove()

Overrides default java.util.Iterator.remove.

Throw UnsupportedOperationException.

private void
updateSingeItemIterator(SelectItem
the SelectItem to expose as an Iterator
item
)

Update the singleItemIterator with the provided item

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ctxback to summary
private FacesContext ctx

The FacesContext for the current request.

itemsback to summary
private Iterator<SelectItem> items

Iterator over the SelectItem elements pointed at by a UISelectItems component, or null.

kidsback to summary
private ListIterator<UIComponent> kids

Iterator over the children of the parent component.

singleItemIteratorback to summary
private SelectItemsIterator.SingleElementIterator singleItemIterator

Expose single SelectItems via an Iterator. This iterator will be reset/reused for each individual SelectItem instance encountered.

Constructor Detail

SelectItemsIteratorback to summary
public SelectItemsIterator(FacesContext ctx, UIComponent parent)

Construct an iterator instance for the specified parent component.

Parameters
ctx:FacesContext

the FacesContext for the current request

parent:UIComponent

The parent UIComponent whose children will be processed

Method Detail

findNextValidChildback to summary
private Object findNextValidChild()
Returns:Object

the next valid child for processing

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Return true if the iteration has more elements.

Returns:boolean

Doc from java.util.Iterator.hasNext.

true if the iteration has more elements

Annotations
@Override
initializeItemsback to summary
private void initializeItems(Object kid)

Initializes the items instance variable with an Iterator appropriate to the UISelectItem(s) value.

nextback to summary
public SelectItem next()

Implements java.util.Iterator.next.

Return the next element in the iteration.

Returns:SelectItem

Doc from java.util.Iterator.next.

the next element in the iteration

Annotations
@SuppressWarnings:unchecked
@Override
Exceptions
NoSuchElementException:
if there are no more elements
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Throw UnsupportedOperationException.

Annotations
@Override
updateSingeItemIteratorback to summary
private void updateSingeItemIterator(SelectItem item)

Update the singleItemIterator with the provided item

Parameters
item:SelectItem

the SelectItem to expose as an Iterator

jakarta.faces.component back to summary

private final Class SelectItemsIterator.ArrayIterator

extends GenericObjectSelectItemIterator
Class Inheritance

Handles arrays of SelectItems, generic Objects, or combintations of both. A single GenericObjectSelectItem will be leverage for any non-SelectItem objects encountered.

Field Summary

Modifier and TypeField and Description
private Object
private int
private FacesContext
private int
Inherited from jakarta.faces.component.SelectItemsIterator.GenericObjectSelectItemIterator:
sourceComponent

Constructor Summary

AccessConstructor and Description
private
ArrayIterator(FacesContext ctx, UISelectItems sourceComponent, Object array)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
public SelectItem
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).
Inherited from jakarta.faces.component.SelectItemsIterator.GenericObjectSelectItemIterator:
getSelectItemFor

Field Detail

arrayback to summary
private Object array
countback to summary
private int count
ctxback to summary
private FacesContext ctx
indexback to summary
private int index

Constructor Detail

ArrayIteratorback to summary
private ArrayIterator(FacesContext ctx, UISelectItems sourceComponent, Object array)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public SelectItem next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:SelectItem

the next element in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

Annotations
@Override
jakarta.faces.component back to summary

private abstract Class SelectItemsIterator.GenericObjectSelectItemIterator

extends Object
implements Iterator<SelectItem>
Class Inheritance
  • java.lang.Object
  • jakarta.faces.component.SelectItemsIterator.GenericObjectSelectItemIterator
All Implemented Interfaces
java.util.Iterator
Known Direct Subclasses
jakarta.faces.component.SelectItemsIterator.ArrayIterator, jakarta.faces.component.SelectItemsIterator.IterableItemIterator

Base class to support iterating over Collections or Arrays that may or may not contain SelectItem instances.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
SelectItemsIterator.GenericObjectSelectItemIterator.GenericObjectSelectItem

A SelectItem implementation to support generating unique SelectItem values based on ValueExpressions from the owning UISelectItems instance.

Field Summary

Modifier and TypeField and Description
private SelectItemsIterator.GenericObjectSelectItemIterator.GenericObjectSelectItem
genericObjectSI

SelectItem that is updated based on the current Object being iterated over.

protected UISelectItems
sourceComponent

The source UISelectItems.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected SelectItem
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

genericObjectSIback to summary
private SelectItemsIterator.GenericObjectSelectItemIterator.GenericObjectSelectItem genericObjectSI

SelectItem that is updated based on the current Object being iterated over.

sourceComponentback to summary
protected UISelectItems sourceComponent

The source UISelectItems.

Constructor Detail

GenericObjectSelectItemIteratorback to summary
protected GenericObjectSelectItemIterator(UISelectItems sourceComponent)

Method Detail

getSelectItemForback to summary
protected SelectItem getSelectItemFor(FacesContext ctx, Object value)
jakarta.faces.component back to summary

private final Class SelectItemsIterator.GenericObjectSelectItemIterator.GenericObjectSelectItem

extends SelectItem
Class Inheritance
Annotations
@SuppressWarnings:serial

A SelectItem implementation to support generating unique SelectItem values based on ValueExpressions from the owning UISelectItems instance.

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String
private static final String
private static final String
private ValueExpression
itemDescription

Resolves to the description of the SelectItem.

private ValueExpression
itemDisabled

Determines the value for the disabled property of the SelectItem/

private ValueExpression
itemEscaped

Determines the value for the escaped property of the SelectItem.

private ValueExpression
itemLabel

Resolves to the label of the SelectItem.

private ValueExpression
itemValue

Resolves to the value of the SelectItem.

private static final String
private ValueExpression
noSelectionOption

Hides jakarta.faces.model.SelectItem.noSelectionOption.

Determines the value for the noSelectionOption property of the SelectItem/
private UISelectItems
private static final String
private String
var

The request-scoped variable under which the current object will be exposed.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
private void
updateItem(FacesContext
the FacesContext for the current request
ctx
,
Object
the value to build the updated values from
value
)

Updates the SelectItem properties based on the current value.

private void
Inherited from jakarta.faces.model.SelectItem:
getDescriptiongetLabelgetValueisDisabledisEscapeisNoSelectionOptionsetDescriptionsetDisabledsetEscapesetLabelsetNoSelectionOptionsetValue

Field Detail

ITEM_DESCRIPTIONback to summary
private static final String ITEM_DESCRIPTION
ITEM_DISABLEDback to summary
private static final String ITEM_DISABLED
ITEM_ESCAPEDback to summary
private static final String ITEM_ESCAPED
ITEM_LABELback to summary
private static final String ITEM_LABEL
ITEM_VALUEback to summary
private static final String ITEM_VALUE
itemDescriptionback to summary
private ValueExpression itemDescription

Resolves to the description of the SelectItem.

itemDisabledback to summary
private ValueExpression itemDisabled

Determines the value for the disabled property of the SelectItem/

itemEscapedback to summary
private ValueExpression itemEscaped

Determines the value for the escaped property of the SelectItem.

itemLabelback to summary
private ValueExpression itemLabel

Resolves to the label of the SelectItem.

itemValueback to summary
private ValueExpression itemValue

Resolves to the value of the SelectItem.

NO_SELECTION_OPTIONback to summary
private static final String NO_SELECTION_OPTION
noSelectionOptionback to summary
private ValueExpression noSelectionOption

Hides jakarta.faces.model.SelectItem.noSelectionOption.

Determines the value for the noSelectionOption property of the SelectItem/

sourceComponentback to summary
private UISelectItems sourceComponent
VARback to summary
private static final String VAR
varback to summary
private String var

The request-scoped variable under which the current object will be exposed.

Constructor Detail

GenericObjectSelectItemback to summary
private GenericObjectSelectItem(UISelectItems sourceComponent)

Method Detail

readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException
updateItemback to summary
private void updateItem(FacesContext ctx, Object value)

Updates the SelectItem properties based on the current value.

Parameters
ctx:FacesContext

the FacesContext for the current request

value:Object

the value to build the updated values from

writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException
jakarta.faces.component back to summary

private final Class SelectItemsIterator.IterableItemIterator

extends GenericObjectSelectItemIterator
Class Inheritance

Handles Collections of SelectItems, generic Objects, or combintations of both. A single GenericObjectSelectItem will be leverage for any non-SelectItem objects encountered.

Field Summary

Modifier and TypeField and Description
private FacesContext
private Iterator<?>
Inherited from jakarta.faces.component.SelectItemsIterator.GenericObjectSelectItemIterator:
sourceComponent

Constructor Summary

AccessConstructor and Description
private
IterableItemIterator(FacesContext ctx, UISelectItems sourceComponent, Iterable<?> iterable)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
public SelectItem
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).
Inherited from jakarta.faces.component.SelectItemsIterator.GenericObjectSelectItemIterator:
getSelectItemFor

Field Detail

ctxback to summary
private FacesContext ctx
iteratorback to summary
private Iterator<?> iterator

Constructor Detail

IterableItemIteratorback to summary
private IterableItemIterator(FacesContext ctx, UISelectItems sourceComponent, Iterable<?> iterable)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public SelectItem next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:SelectItem

the next element in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

Annotations
@Override
jakarta.faces.component back to summary

private final Class SelectItemsIterator.MapIterator

extends Object
implements Iterator<SelectItem>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Iterates over a Map of values exposing each entry as a SelectItem. Note that this will do so re-using the same SelectItem but changing the value and label as appropriate.

Field Summary

Modifier and TypeField and Description
private SelectItem
private Iterator<E>

Constructor Summary

AccessConstructor and Description
private
MapIterator(Map<K, V> map)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
public SelectItem
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

itemback to summary
private SelectItem item
iteratorback to summary
private Iterator<E> iterator

Constructor Detail

MapIteratorback to summary
private MapIterator(Map<K, V> map)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public SelectItem next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:SelectItem

the next element in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

Annotations
@Override
jakarta.faces.component back to summary

private final Class SelectItemsIterator.SingleElementIterator

extends Object
implements Iterator<SelectItem>
Class Inheritance
  • java.lang.Object
  • jakarta.faces.component.SelectItemsIterator.SingleElementIterator
All Implemented Interfaces
java.util.Iterator

Exposes single SelectItem instances as an Iterator.

Field Summary

Modifier and TypeField and Description
private SelectItem
private boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
public SelectItem
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

itemback to summary
private SelectItem item
nextCalledback to summary
private boolean nextCalled

Constructor Detail

SingleElementIteratorback to summary
private SingleElementIterator()

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public SelectItem next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:SelectItem

the next element in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

Annotations
@Override
updateItemback to summary
private void updateItem(SelectItem item)