KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > facelets > tag > jstl > core > IterationStatusExpression


1 /**
2  * Licensed under the Common Development and Distribution License,
3  * you may not use this file except in compliance with the License.
4  * You may obtain a copy of the License at
5  *
6  * http://www.sun.com/cddl/
7  *
8  * Unless required by applicable law or agreed to in writing, software
9  * distributed under the License is distributed on an "AS IS" BASIS,
10  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11  * implied. See the License for the specific language governing
12  * permissions and limitations under the License.
13  */

14
15 package com.sun.facelets.tag.jstl.core;
16
17 import javax.el.ELContext;
18 import javax.el.ValueExpression;
19
20 /**
21  * @author Jacob Hookom
22  * @version $Id: IterationStatusExpression.java,v 1.3 2005/08/24 04:38:52 jhook Exp $
23  */

24 public final class IterationStatusExpression extends ValueExpression {
25
26     /**
27      *
28      */

29     private static final long serialVersionUID = 1L;
30
31     private final IterationStatus status;
32
33     /**
34      *
35      */

36     public IterationStatusExpression(IterationStatus status) {
37         this.status = status;
38     }
39
40     /*
41      * (non-Javadoc)
42      *
43      * @see javax.el.ValueExpression#getValue(javax.el.ELContext)
44      */

45     public Object JavaDoc getValue(ELContext context) {
46         return this.status;
47     }
48
49     /*
50      * (non-Javadoc)
51      *
52      * @see javax.el.ValueExpression#setValue(javax.el.ELContext,
53      * java.lang.Object)
54      */

55     public void setValue(ELContext context, Object JavaDoc value) {
56         throw new UnsupportedOperationException JavaDoc("Cannot set IterationStatus");
57     }
58
59     /*
60      * (non-Javadoc)
61      *
62      * @see javax.el.ValueExpression#isReadOnly(javax.el.ELContext)
63      */

64     public boolean isReadOnly(ELContext context) {
65         return true;
66     }
67
68     /*
69      * (non-Javadoc)
70      *
71      * @see javax.el.ValueExpression#getType(javax.el.ELContext)
72      */

73     public Class JavaDoc getType(ELContext context) {
74         return IterationStatus.class;
75     }
76
77     /*
78      * (non-Javadoc)
79      *
80      * @see javax.el.ValueExpression#getExpectedType()
81      */

82     public Class JavaDoc getExpectedType() {
83         return IterationStatus.class;
84     }
85
86     /*
87      * (non-Javadoc)
88      *
89      * @see javax.el.Expression#getExpressionString()
90      */

91     public String JavaDoc getExpressionString() {
92         return this.toString();
93     }
94
95     /*
96      * (non-Javadoc)
97      *
98      * @see javax.el.Expression#equals(java.lang.Object)
99      */

100     public boolean equals(Object JavaDoc obj) {
101         return this.status.equals(obj);
102     }
103
104     /*
105      * (non-Javadoc)
106      *
107      * @see javax.el.Expression#hashCode()
108      */

109     public int hashCode() {
110         return this.status.hashCode();
111     }
112
113     /*
114      * (non-Javadoc)
115      *
116      * @see javax.el.Expression#isLiteralText()
117      */

118     public boolean isLiteralText() {
119         return true;
120     }
121
122     public String JavaDoc toString() {
123         return this.status.toString();
124     }
125
126 }
127
Popular Tags