01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.compiler.impl;
11:
12: public class StringConstant extends Constant {
13: private String value;
14:
15: public static Constant fromValue(String value) {
16: return new StringConstant(value);
17: }
18:
19: private StringConstant(String value) {
20: this .value = value;
21: }
22:
23: public String stringValue() {
24: //spec 15.17.11
25:
26: //the next line do not go into the toString() send....!
27: return value;
28:
29: /*
30: String s = value.toString() ;
31: if (s == null)
32: return "null";
33: else
34: return s;
35: */
36:
37: }
38:
39: public String toString() {
40:
41: return "(String)\"" + value + "\"";} //$NON-NLS-2$ //$NON-NLS-1$
42:
43: public int typeID() {
44: return T_JavaLangString;
45: }
46: }
|