1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.portals.bridges.jsf;
17
18 import java.util.Enumeration;
19
20 /***
21 * <p>
22 * Enumeration without elements
23 * </p>
24 * <p>
25 * Code provided by MyFaces project.
26 * </p>
27 *
28 * @author <a href="dlestrat@apache.org">David Le Strat </a>
29 */
30 public final class NullEnumeration implements Enumeration
31 {
32 /*** Null enumeration. */
33 private static final NullEnumeration nullEnumeration = new NullEnumeration();
34
35 /***
36 * @return An instance of the enumeration.
37 */
38 public static final NullEnumeration instance()
39 {
40 return nullEnumeration;
41 }
42
43 /***
44 * @see java.util.Enumeration#hasMoreElements()
45 */
46 public boolean hasMoreElements()
47 {
48 return false;
49 }
50
51 /***
52 * @see java.util.Enumeration#nextElement()
53 */
54 public Object nextElement()
55 {
56 throw new UnsupportedOperationException("NullEnumeration has no elements");
57 }
58 }