public final class JsfSelectItemUtil extends Object
Modifier and Type | Field and Description |
---|---|
static javax.faces.model.SelectItem[] |
EMPTY_ARRAY_OF_SELECT_ITEMS
Empty array of
SelectItems . |
Modifier and Type | Method and Description |
---|---|
static String |
getLabelFromSelectItemsAndValue(javax.faces.model.SelectItem[] selectItems,
Object value)
Gets the label of the SelectItem with the supplied value from the supplied selectItems.
|
static String |
getLabelsFromSelectItemsAndValues(javax.faces.model.SelectItem[] selectItems,
Object values)
Gets the labels of the supplied selectItems, corresponding to the supplied values, as a comma separated list.
|
static List<javax.faces.model.SelectItem> |
getSelectItems(javax.faces.component.UIInput uiInput)
Gets all the SelectItems from the supplied uiComponent.
|
static boolean |
hasZeroOrOneSelectItem(javax.faces.component.UIInput uiInput)
Determines whether the supplied uiComponent contains zero or one
SelectItem . |
public static final javax.faces.model.SelectItem[] EMPTY_ARRAY_OF_SELECT_ITEMS
SelectItems
.public static boolean hasZeroOrOneSelectItem(javax.faces.component.UIInput uiInput)
SelectItem
.uiInput
- The component to check.SelectItem
,
otherwise false is returned.public static List<javax.faces.model.SelectItem> getSelectItems(javax.faces.component.UIInput uiInput)
uiInput
- The component to get the SelectItems from.IllegalStateException
- When the SelectItems are not backed by a single SelectItem, Collection, Array or Map.public static String getLabelFromSelectItemsAndValue(javax.faces.model.SelectItem[] selectItems, Object value)
selectItems
- The select items to get a single label from.value
- The value of the select item.IllegalArgumentException
- When the supplied selectItems is empty or when the supplied selectItems does not
contain a SelectItem with the supplied value.NullPointerException
- When the supplied selectItems is null.public static String getLabelsFromSelectItemsAndValues(javax.faces.model.SelectItem[] selectItems, Object values)
selectItems
- The select items to get the labels from.values
- The selected values.
IllegalArgumentException
- When the supplied selectItems is empty.NullPointerException
- When the supplied selectItems or values are null.Copyright © 2008–2018. All rights reserved.