KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > script > el > LiteralTerm


1 /*
2  * Copyright 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  * $Header:$
17  */

18 package org.apache.beehive.netui.script.el;
19
20 import org.apache.beehive.netui.util.logging.Logger;
21
22 /**
23  *
24  */

25 public class LiteralTerm
26     implements Term {
27
28     private static final Logger LOGGER = Logger.getInstance(LiteralTerm.class);
29
30     private String JavaDoc text = null;
31
32     public LiteralTerm(String JavaDoc text) {
33         super();
34
35         /* todo: probably being lazy in not fixing the grammar */
36         if(text.equals("\\{"))
37             this.text = "{";
38         else
39             this.text = text;
40
41         if(LOGGER.isDebugEnabled())
42             LOGGER.debug("LiteralTerm text: " + text + " this.text: " + this.text);
43     }
44
45     public void seal() {
46     }
47
48     public String JavaDoc getExpressionString() {
49         return text;
50     }
51
52     public Object JavaDoc evaluate(NetUIVariableResolver vr) {
53         return text;
54     }
55
56     public String JavaDoc toString() {
57         return "LiteralTerm:\n " + text + "\n";
58     }
59 }
60
61
Popular Tags