public final class JsfSelectItemsFromEnumsUtil extends Object
SelectItems
from Enumerations
.Modifier and Type | Method and Description |
---|---|
static <E extends Enum<E>> |
enumSetToSelectItems(EnumSet<E> enumSet)
Converts the supplied enumSet, to a List of non localized
SelectItem objects. |
static <E extends Enum<E>> |
enumSetToSelectItems(EnumSet<E> enumSet,
Locale locale)
Converts the supplied enumSet, to a List of localized
SelectItem objects. |
static <E extends Enum<E>> |
enumsToSelectItems(Class<E> enumClass)
Converts the supplied enumClass, to a List of non localized
SelectItem objects. |
static <E extends Enum<E>> |
enumsToSelectItems(Class<E> enumClass,
Locale locale)
Converts the supplied enumClass, to a List of localized
SelectItem objects. |
public static <E extends Enum<E>> List<javax.faces.model.SelectItem> enumsToSelectItems(Class<E> enumClass)
SelectItem
objects.
E
- The type of the enumeration.enumClass
- The enumerated type to convert.NullPointerException
- When the supplied enumClass is null.public static <E extends Enum<E>> List<javax.faces.model.SelectItem> enumsToSelectItems(Class<E> enumClass, Locale locale)
SelectItem
objects.
E
- The type of the enumeration.enumClass
- The enumerated type to convert.
LocalizableEnumeration
.locale
- The locale to create the properly translated labels.
NullPointerException
- When the supplied enumClass is null.CEnumeration.getDescription(Enum, Locale)
public static <E extends Enum<E>> List<javax.faces.model.SelectItem> enumSetToSelectItems(EnumSet<E> enumSet)
SelectItem
objects.
E
- The type of the enumeration.enumSet
- The EnumSet to convert.NullPointerException
- When the supplied enumSet is null.public static <E extends Enum<E>> List<javax.faces.model.SelectItem> enumSetToSelectItems(EnumSet<E> enumSet, Locale locale)
SelectItem
objects.
E
- The type of the enumeration.enumSet
- The EnumSet to convert to SelectItems.
LocalizableEnumeration
.locale
- The locale to create the properly translated labels.
NullPointerException
- When the supplied enumSet is null.CEnumeration.getDescription(Enum, Locale)
Copyright © 2008–2018. All rights reserved.