1 11 package org.eclipse.jdt.internal.debug.core.logicalstructures; 12 13 import org.eclipse.core.runtime.PlatformObject; 14 import org.eclipse.debug.core.DebugException; 15 import org.eclipse.debug.core.ILaunch; 16 import org.eclipse.debug.core.model.IDebugTarget; 17 import org.eclipse.debug.core.model.IValue; 18 import org.eclipse.jdt.debug.core.IJavaModifiers; 19 import org.eclipse.jdt.debug.core.IJavaType; 20 import org.eclipse.jdt.debug.core.IJavaValue; 21 import org.eclipse.jdt.debug.core.IJavaVariable; 22 23 30 public class JDIPlaceholderVariable extends PlatformObject implements IJavaVariable { 31 32 private String fName; 33 private IJavaValue fValue; 34 35 public JDIPlaceholderVariable(String name, IJavaValue value) { 36 fName = name; 37 fValue = value; 38 } 39 40 43 public String getSignature() throws DebugException { 44 return ((IJavaValue)getValue()).getSignature(); 45 } 46 47 50 public String getGenericSignature() throws DebugException { 51 return ((IJavaValue)getValue()).getGenericSignature(); 52 } 53 54 57 public IJavaType getJavaType() throws DebugException { 58 return ((IJavaValue)getValue()).getJavaType(); 59 } 60 61 64 public boolean isLocal() { 65 return false; 66 } 67 68 71 public IValue getValue() { 72 return fValue; 73 } 74 75 78 public String getName() { 79 return fName; 80 } 81 82 85 public String getReferenceTypeName() throws DebugException { 86 return ((IJavaValue)getValue()).getReferenceTypeName(); 87 } 88 89 92 public boolean hasValueChanged() { 93 return false; 94 } 95 96 99 public boolean isPublic() { 100 return false; 101 } 102 103 106 public boolean isPrivate() { 107 return false; 108 } 109 110 113 public boolean isProtected() { 114 return false; 115 } 116 117 120 public boolean isPackagePrivate() { 121 return false; 122 } 123 124 127 public boolean isFinal() { 128 return false; 129 } 130 131 134 public boolean isStatic() { 135 return false; 136 } 137 138 141 public boolean isSynthetic() { 142 return false; 143 } 144 145 148 public String getModelIdentifier() { 149 return getValue().getModelIdentifier(); 150 } 151 152 155 public IDebugTarget getDebugTarget() { 156 return ((IJavaValue)getValue()).getDebugTarget(); 157 } 158 159 162 public ILaunch getLaunch() { 163 return getValue().getLaunch(); 164 } 165 166 169 public void setValue(String expression) { 170 } 171 172 175 public void setValue(IValue value) { 176 } 177 178 181 public boolean supportsValueModification() { 182 return false; 183 } 184 185 188 public boolean verifyValue(String expression) { 189 return false; 190 } 191 192 195 public boolean verifyValue(IValue value) { 196 return false; 197 } 198 199 202 public Object getAdapter(Class adapter) { 203 if (IJavaVariable.class.equals(adapter) || 204 IJavaModifiers.class.equals(adapter)) { 205 return this; 206 } 207 return super.getAdapter(adapter); 208 } 209 210 213 public boolean equals(Object obj) { 214 if (obj instanceof JDIPlaceholderVariable) { 215 JDIPlaceholderVariable var = (JDIPlaceholderVariable)obj; 216 return var.getName().equals(getName()) && var.getValue().equals(getValue()); 217 } 218 return false; 219 } 220 221 224 public int hashCode() { 225 return fName.hashCode() + fValue.hashCode(); 226 } 227 228 } 229 | Popular Tags |