blob: aea85c3a0c50a366e42d22073c1c82b27cf645b5 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.e4.languages.javascript.rhino.jsdi;
import java.util.Map;
import org.eclipse.e4.languages.javascript.jsdi.StringValue;
/**
* Rhino implementation of a string reference
*
* @since 1.0
*/
public class StringValueImpl extends MirrorImpl implements StringValue {
String value;
public StringValueImpl(VirtualMachineImpl vm, String value) {
super(vm);
this.value = value;
}
public StringValueImpl(VirtualMachineImpl vm, Map body) {
this(vm, (String) body.get("value"));
}
/*
* (non-Javadoc)
*
* @see org.eclipse.e4.languages.javascript.jsdi.StringReference#value()
*/
public String value() {
return value;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.e4.languages.javascript.jsdi.rhino.MirrorImpl#toString()
*/
public String toString() {
return value();
}
public String getValueTypeName() {
return "string";
}
}