1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.jexl.parser;
17
18 import org.apache.commons.jexl.JexlContext;
19
20 /***
21 * represents a quoted string.
22 *
23 * @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
24 * @version $Id: ASTStringLiteral.java 398324 2006-04-30 12:20:24Z dion $
25 */
26 public class ASTStringLiteral extends SimpleNode {
27 /*** the parsed literal. */
28 protected String literal;
29
30 /***
31 * Create the node given an id.
32 *
33 * @param id node id.
34 */
35 public ASTStringLiteral(int id) {
36 super(id);
37 }
38
39 /***
40 * Create a node with the given parser and id.
41 *
42 * @param p a parser.
43 * @param id node id.
44 */
45 public ASTStringLiteral(Parser p, int id) {
46 super(p, id);
47 }
48
49 /*** {@inheritDoc} */
50 public Object jjtAccept(ParserVisitor visitor, Object data) {
51 return visitor.visit(this, data);
52 }
53
54 /*** {@inheritDoc} */
55 public Object value(JexlContext jc) throws Exception {
56 return literal;
57 }
58 }