/******************************************************************************* * Copyright (c) 2011, 2015 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.jdt.debug.tests.ui.presentation; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.model.IDebugTarget; import org.eclipse.debug.core.model.IVariable; import org.eclipse.jdt.debug.core.IJavaType; import org.eclipse.jdt.debug.core.IJavaValue; import org.eclipse.jdt.debug.core.JDIDebugModel; /** * */ public class TestIJavaValue implements IJavaValue { IJavaType type = null; String sig; String gsig; String rtname; String vstring; public TestIJavaValue(IJavaType type, String sig, String gsig, String rtname, String vstring) { this.type = type; this.sig = sig; this.gsig = gsig; this.rtname = rtname; this.vstring = vstring; } /* (non-Javadoc) * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName() */ @Override public String getReferenceTypeName() throws DebugException { return rtname; } /* (non-Javadoc) * @see org.eclipse.debug.core.model.IValue#getValueString() */ @Override public String getValueString() throws DebugException { return vstring; } /* (non-Javadoc) * @see org.eclipse.debug.core.model.IValue#isAllocated() */ @Override public boolean isAllocated() throws DebugException { return true; } /* (non-Javadoc) * @see org.eclipse.debug.core.model.IValue#getVariables() */ @Override public IVariable[] getVariables() throws DebugException { return new IVariable[0]; } /* (non-Javadoc) * @see org.eclipse.debug.core.model.IValue#hasVariables() */ @Override public boolean hasVariables() throws DebugException { return false; } /* (non-Javadoc) * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier() */ @Override public String getModelIdentifier() { return JDIDebugModel.getPluginIdentifier(); } /* (non-Javadoc) * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget() */ @Override public IDebugTarget getDebugTarget() { return null; } /* (non-Javadoc) * @see org.eclipse.debug.core.model.IDebugElement#getLaunch() */ @Override public ILaunch getLaunch() { return null; } /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ @Override public <T> T getAdapter(Class<T> adapter) { return null; } /* (non-Javadoc) * @see org.eclipse.jdt.debug.core.IJavaValue#getSignature() */ @Override public String getSignature() throws DebugException { return sig; } /* (non-Javadoc) * @see org.eclipse.jdt.debug.core.IJavaValue#getGenericSignature() */ @Override public String getGenericSignature() throws DebugException { return gsig; } /* (non-Javadoc) * @see org.eclipse.jdt.debug.core.IJavaValue#getJavaType() */ @Override public IJavaType getJavaType() throws DebugException { return type; } /* (non-Javadoc) * @see org.eclipse.jdt.debug.core.IJavaValue#isNull() */ @Override public boolean isNull() { return false; } }