01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.netui.script.el;
20:
21: import org.apache.beehive.netui.util.logging.Logger;
22:
23: /**
24: *
25: */
26: public class LiteralTerm implements Term {
27:
28: private static final Logger LOGGER = Logger
29: .getInstance(LiteralTerm.class);
30: private static final boolean TRACE_ENABLED = LOGGER
31: .isTraceEnabled();
32:
33: private String _text = null;
34:
35: public LiteralTerm(String text) {
36: super ();
37:
38: /* todo: probably being lazy in not fixing the grammar */
39: if (text.equals("\\{"))
40: _text = "{";
41: else
42: _text = text;
43:
44: if (TRACE_ENABLED)
45: LOGGER.trace("LiteralTerm: " + text);
46: }
47:
48: public void seal() {
49: }
50:
51: public String getExpressionString() {
52: return _text;
53: }
54:
55: public Object read(NetUIVariableResolver vr) {
56: return _text;
57: }
58:
59: public String toString() {
60: return "LiteralTerm:\n " + _text + "\n";
61: }
62: }
|