KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > standard > lang > jstl > PropertySuffix


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.taglibs.standard.lang.jstl;
18
19 import java.util.Map JavaDoc;
20
21 /**
22  *
23  * <p>Represents an operator that obtains the value of another value's
24  * property. This is a specialization of ArraySuffix - a.b is
25  * equivalent to a["b"]
26  *
27  * @author Nathan Abramson - Art Technology Group
28  * @author Shawn Bayern
29  * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: pierred $
30  **/

31
32 public class PropertySuffix
33   extends ArraySuffix
34 {
35   //-------------------------------------
36
// Properties
37
//-------------------------------------
38
// property name
39

40   String JavaDoc mName;
41   public String JavaDoc getName ()
42   { return mName; }
43   public void setName (String JavaDoc pName)
44   { mName = pName; }
45
46   //-------------------------------------
47
/**
48    *
49    * Constructor
50    **/

51   public PropertySuffix (String JavaDoc pName)
52   {
53     super (null);
54     mName = pName;
55   }
56
57   //-------------------------------------
58
/**
59    *
60    * Gets the value of the index
61    **/

62   Object JavaDoc evaluateIndex (Object JavaDoc pContext,
63                         VariableResolver pResolver,
64                         Map JavaDoc functions,
65                         String JavaDoc defaultPrefix,
66                         Logger pLogger)
67     throws ELException
68   {
69     return mName;
70   }
71
72   //-------------------------------------
73
/**
74    *
75    * Returns the operator symbol
76    **/

77   String JavaDoc getOperatorSymbol ()
78   {
79     return ".";
80   }
81
82   //-------------------------------------
83
// ValueSuffix methods
84
//-------------------------------------
85
/**
86    *
87    * Returns the expression in the expression language syntax
88    **/

89   public String JavaDoc getExpressionString ()
90   {
91     return "." + StringLiteral.toIdentifierToken (mName);
92   }
93
94   //-------------------------------------
95
}
96
Popular Tags