1 11 package org.eclipse.jdt.internal.debug.eval.ast.engine; 12 13 14 import org.eclipse.core.runtime.IStatus; 15 import org.eclipse.core.runtime.Status; 16 import org.eclipse.debug.core.DebugException; 17 import org.eclipse.debug.core.ILaunch; 18 import org.eclipse.debug.core.model.IDebugTarget; 19 import org.eclipse.debug.core.model.IValue; 20 import org.eclipse.jdt.debug.core.IJavaType; 21 import org.eclipse.jdt.debug.core.IJavaVariable; 22 import org.eclipse.jdt.debug.core.JDIDebugModel; 23 24 public class InterpreterVariable implements IJavaVariable { 25 26 29 private IJavaType fReferenceType; 30 31 34 private String fName; 35 36 39 private IValue fValue; 40 41 private IDebugTarget fDebugTarget; 42 43 public InterpreterVariable(String name, IJavaType referenceType, IDebugTarget debugTarget) { 44 fName= name; 45 fReferenceType= referenceType; 46 fDebugTarget= debugTarget; 47 } 48 49 52 public IValue getValue() { 53 return fValue; 54 } 55 56 59 public String getName() { 60 return fName; 61 } 62 63 66 public String getReferenceTypeName() throws DebugException { 67 return fReferenceType.getName(); 68 } 69 70 73 public boolean hasValueChanged() { 74 return false; 75 } 76 77 80 public String getModelIdentifier() { 81 return JDIDebugModel.getPluginIdentifier(); 82 } 83 84 87 public IDebugTarget getDebugTarget() { 88 return fDebugTarget; 89 } 90 91 94 public ILaunch getLaunch() { 95 return fDebugTarget.getLaunch(); 96 } 97 98 101 public void setValue(String expression) throws DebugException { 102 throw new DebugException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), DebugException.NOT_SUPPORTED, EvaluationEngineMessages.InterpreterVariable_setValue_String__not_supported_for_interpreter_variable_1, null)); 103 } 104 105 108 public void setValue(IValue value) { 109 fValue= value; 110 } 111 112 115 public boolean supportsValueModification() { 116 return false; 117 } 118 119 122 public boolean verifyValue(IValue value) throws DebugException { 123 throw new DebugException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), DebugException.NOT_SUPPORTED, EvaluationEngineMessages.InterpreterVariable_verifyValue_IValue__not_supported_for_interpreter_variable_2, null)); 124 } 125 126 129 public boolean verifyValue(String expression) throws DebugException { 130 throw new DebugException(new Status(IStatus.ERROR, JDIDebugModel.getPluginIdentifier(), DebugException.NOT_SUPPORTED, EvaluationEngineMessages.InterpreterVariable_verifyValue_String__not_supported_for_interpreter_variable_3, null)); 131 } 132 133 136 public Object getAdapter(Class adapter) { 137 return null; 138 } 139 140 143 public IJavaType getJavaType() { 144 return fReferenceType; 145 } 146 147 150 public String getSignature() throws DebugException { 151 return fReferenceType.getSignature(); 152 } 153 154 157 public boolean isFinal() { 158 return false; 159 } 160 161 164 public boolean isPackagePrivate() { 165 return false; 166 } 167 168 171 public boolean isPrivate() { 172 return false; 173 } 174 175 178 public boolean isProtected() { 179 return false; 180 } 181 182 185 public boolean isPublic() { 186 return true; 187 } 188 189 192 public boolean isStatic() { 193 return false; 194 } 195 196 199 public boolean isSynthetic() { 200 return true; 201 } 202 203 206 public boolean isLocal() { 207 return false; 208 } 209 210 213 public String getGenericSignature() throws DebugException { 214 return getSignature(); 215 } 216 } 217 | Popular Tags |