]>
Commit | Line | Data |
---|---|---|
625f3718 EK |
1 | package no.uio.ifi.refaktor.utils; |
2 | ||
3 | import org.eclipse.core.resources.IMarker; | |
4 | import org.eclipse.core.resources.IResource; | |
5 | import org.eclipse.core.runtime.IPath; | |
6 | import org.eclipse.core.runtime.IProgressMonitor; | |
7 | import org.eclipse.core.runtime.jobs.ISchedulingRule; | |
8 | import org.eclipse.jdt.core.CompletionRequestor; | |
9 | import org.eclipse.jdt.core.IBuffer; | |
10 | import org.eclipse.jdt.core.IBufferFactory; | |
11 | import org.eclipse.jdt.core.ICodeCompletionRequestor; | |
12 | import org.eclipse.jdt.core.ICompilationUnit; | |
13 | import org.eclipse.jdt.core.ICompletionRequestor; | |
14 | import org.eclipse.jdt.core.IImportContainer; | |
15 | import org.eclipse.jdt.core.IImportDeclaration; | |
16 | import org.eclipse.jdt.core.IJavaElement; | |
17 | import org.eclipse.jdt.core.IJavaModel; | |
18 | import org.eclipse.jdt.core.IJavaProject; | |
19 | import org.eclipse.jdt.core.IOpenable; | |
20 | import org.eclipse.jdt.core.IPackageDeclaration; | |
21 | import org.eclipse.jdt.core.IProblemRequestor; | |
22 | import org.eclipse.jdt.core.ISourceRange; | |
23 | import org.eclipse.jdt.core.IType; | |
24 | import org.eclipse.jdt.core.JavaModelException; | |
25 | import org.eclipse.jdt.core.WorkingCopyOwner; | |
26 | import org.eclipse.jdt.core.dom.CompilationUnit; | |
27 | import org.eclipse.text.edits.TextEdit; | |
28 | import org.eclipse.text.edits.UndoEdit; | |
29 | ||
30 | @SuppressWarnings("deprecation") | |
31 | public class NullCompilationUnit implements ICompilationUnit { | |
32 | ||
33 | @Override | |
34 | public IType findPrimaryType() { | |
35 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
36 | } | |
37 | ||
38 | @Override | |
39 | public IJavaElement getElementAt(int position) throws JavaModelException { | |
40 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
41 | } | |
42 | ||
43 | @Override | |
44 | public ICompilationUnit getWorkingCopy(WorkingCopyOwner owner, | |
45 | IProgressMonitor monitor) throws JavaModelException { | |
46 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
47 | } | |
48 | ||
49 | @Override | |
50 | public boolean exists() { | |
51 | return false; | |
52 | } | |
53 | ||
54 | @Override | |
55 | public IJavaElement getAncestor(int ancestorType) { | |
56 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
57 | } | |
58 | ||
59 | @Override | |
60 | public String getAttachedJavadoc(IProgressMonitor monitor) | |
61 | throws JavaModelException { | |
62 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
63 | } | |
64 | ||
65 | @Override | |
66 | public IResource getCorrespondingResource() throws JavaModelException { | |
67 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
68 | } | |
69 | ||
70 | @Override | |
71 | public String getElementName() { | |
72 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
73 | } | |
74 | ||
75 | @Override | |
76 | public int getElementType() { | |
77 | return 0; | |
78 | } | |
79 | ||
80 | @Override | |
81 | public String getHandleIdentifier() { | |
82 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
83 | } | |
84 | ||
85 | @Override | |
86 | public IJavaModel getJavaModel() { | |
87 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
88 | } | |
89 | ||
90 | @Override | |
91 | public IJavaProject getJavaProject() { | |
92 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
93 | } | |
94 | ||
95 | @Override | |
96 | public IOpenable getOpenable() { | |
97 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
98 | } | |
99 | ||
100 | @Override | |
101 | public IJavaElement getParent() { | |
102 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
103 | } | |
104 | ||
105 | @Override | |
106 | public IPath getPath() { | |
107 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
108 | } | |
109 | ||
110 | @Override | |
111 | public IJavaElement getPrimaryElement() { | |
112 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
113 | } | |
114 | ||
115 | @Override | |
116 | public IResource getResource() { | |
117 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
118 | } | |
119 | ||
120 | @Override | |
121 | public ISchedulingRule getSchedulingRule() { | |
122 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
123 | } | |
124 | ||
125 | @Override | |
126 | public IResource getUnderlyingResource() throws JavaModelException { | |
127 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
128 | } | |
129 | ||
130 | @Override | |
131 | public boolean isReadOnly() { | |
132 | return true; | |
133 | } | |
134 | ||
135 | @Override | |
136 | public boolean isStructureKnown() throws JavaModelException { | |
137 | return false; | |
138 | } | |
139 | ||
140 | @Override | |
141 | public Object getAdapter(Class adapter) { | |
142 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
143 | } | |
144 | ||
145 | @Override | |
146 | public IJavaElement[] getChildren() throws JavaModelException { | |
147 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
148 | } | |
149 | ||
150 | @Override | |
151 | public boolean hasChildren() throws JavaModelException { | |
152 | return false; | |
153 | } | |
154 | ||
155 | @Override | |
156 | public void close() throws JavaModelException { | |
157 | ||
158 | } | |
159 | ||
160 | @Override | |
161 | public String findRecommendedLineSeparator() throws JavaModelException { | |
162 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
163 | } | |
164 | ||
165 | @Override | |
166 | public IBuffer getBuffer() throws JavaModelException { | |
167 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
168 | } | |
169 | ||
170 | @Override | |
171 | public boolean hasUnsavedChanges() throws JavaModelException { | |
172 | return false; | |
173 | } | |
174 | ||
175 | @Override | |
176 | public boolean isConsistent() throws JavaModelException { | |
177 | return false; | |
178 | } | |
179 | ||
180 | @Override | |
181 | public boolean isOpen() { | |
182 | return false; | |
183 | } | |
184 | ||
185 | @Override | |
186 | public void makeConsistent(IProgressMonitor progress) | |
187 | throws JavaModelException { | |
188 | ||
189 | } | |
190 | ||
191 | @Override | |
192 | public void open(IProgressMonitor progress) throws JavaModelException { | |
193 | ||
194 | } | |
195 | ||
196 | @Override | |
197 | public void save(IProgressMonitor progress, boolean force) | |
198 | throws JavaModelException { | |
199 | ||
200 | } | |
201 | ||
202 | @Override | |
203 | public String getSource() throws JavaModelException { | |
204 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
205 | } | |
206 | ||
207 | @Override | |
208 | public ISourceRange getSourceRange() throws JavaModelException { | |
209 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
210 | } | |
211 | ||
212 | @Override | |
213 | public ISourceRange getNameRange() throws JavaModelException { | |
214 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
215 | } | |
216 | ||
217 | @Override | |
218 | public void codeComplete(int offset, ICodeCompletionRequestor requestor) | |
219 | throws JavaModelException { | |
220 | ||
221 | } | |
222 | ||
223 | @Override | |
224 | public void codeComplete(int offset, ICompletionRequestor requestor) | |
225 | throws JavaModelException { | |
226 | ||
227 | } | |
228 | ||
229 | @Override | |
230 | public void codeComplete(int offset, CompletionRequestor requestor) | |
231 | throws JavaModelException { | |
232 | ||
233 | } | |
234 | ||
235 | @Override | |
236 | public void codeComplete(int offset, CompletionRequestor requestor, | |
237 | IProgressMonitor monitor) throws JavaModelException { | |
238 | ||
239 | } | |
240 | ||
241 | @Override | |
242 | public void codeComplete(int offset, ICompletionRequestor requestor, | |
243 | WorkingCopyOwner owner) throws JavaModelException { | |
244 | ||
245 | } | |
246 | ||
247 | @Override | |
248 | public void codeComplete(int offset, CompletionRequestor requestor, | |
249 | WorkingCopyOwner owner) throws JavaModelException { | |
250 | ||
251 | } | |
252 | ||
253 | @Override | |
254 | public void codeComplete(int offset, CompletionRequestor requestor, | |
255 | WorkingCopyOwner owner, IProgressMonitor monitor) | |
256 | throws JavaModelException { | |
257 | ||
258 | } | |
259 | ||
260 | @Override | |
261 | public IJavaElement[] codeSelect(int offset, int length) | |
262 | throws JavaModelException { | |
263 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
264 | } | |
265 | ||
266 | @Override | |
267 | public IJavaElement[] codeSelect(int offset, int length, | |
268 | WorkingCopyOwner owner) throws JavaModelException { | |
269 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
270 | } | |
271 | ||
272 | @Override | |
273 | public void commit(boolean force, IProgressMonitor monitor) | |
274 | throws JavaModelException { | |
275 | ||
276 | } | |
277 | ||
278 | @Override | |
279 | public void destroy() { | |
280 | ||
281 | } | |
282 | ||
283 | @Override | |
284 | public IJavaElement findSharedWorkingCopy(IBufferFactory bufferFactory) { | |
285 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
286 | } | |
287 | ||
288 | @Override | |
289 | public IJavaElement getOriginal(IJavaElement workingCopyElement) { | |
290 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
291 | } | |
292 | ||
293 | @Override | |
294 | public IJavaElement getOriginalElement() { | |
295 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
296 | } | |
297 | ||
298 | @Override | |
299 | public IJavaElement getSharedWorkingCopy(IProgressMonitor monitor, | |
300 | IBufferFactory factory, IProblemRequestor problemRequestor) | |
301 | throws JavaModelException { | |
302 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
303 | } | |
304 | ||
305 | @Override | |
306 | public IJavaElement getWorkingCopy() throws JavaModelException { | |
307 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
308 | } | |
309 | ||
310 | @Override | |
311 | public IJavaElement getWorkingCopy(IProgressMonitor monitor, | |
312 | IBufferFactory factory, IProblemRequestor problemRequestor) | |
313 | throws JavaModelException { | |
314 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
315 | } | |
316 | ||
317 | @Override | |
318 | public boolean isBasedOn(IResource resource) { | |
319 | return false; | |
320 | } | |
321 | ||
322 | @Override | |
323 | public IMarker[] reconcile() throws JavaModelException { | |
324 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
325 | } | |
326 | ||
327 | @Override | |
328 | public void reconcile(boolean forceProblemDetection, | |
329 | IProgressMonitor monitor) throws JavaModelException { | |
330 | ||
331 | } | |
332 | ||
333 | @Override | |
334 | public void copy(IJavaElement container, IJavaElement sibling, | |
335 | String rename, boolean replace, IProgressMonitor monitor) | |
336 | throws JavaModelException { | |
337 | ||
338 | } | |
339 | ||
340 | @Override | |
341 | public void delete(boolean force, IProgressMonitor monitor) | |
342 | throws JavaModelException { | |
343 | ||
344 | } | |
345 | ||
346 | @Override | |
347 | public void move(IJavaElement container, IJavaElement sibling, | |
348 | String rename, boolean replace, IProgressMonitor monitor) | |
349 | throws JavaModelException { | |
350 | ||
351 | } | |
352 | ||
353 | @Override | |
354 | public void rename(String name, boolean replace, IProgressMonitor monitor) | |
355 | throws JavaModelException { | |
356 | ||
357 | } | |
358 | ||
359 | @Override | |
360 | public UndoEdit applyTextEdit(TextEdit edit, IProgressMonitor monitor) | |
361 | throws JavaModelException { | |
362 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
363 | } | |
364 | ||
365 | @Override | |
366 | public void becomeWorkingCopy(IProblemRequestor problemRequestor, | |
367 | IProgressMonitor monitor) throws JavaModelException { | |
368 | ||
369 | } | |
370 | ||
371 | @Override | |
372 | public void becomeWorkingCopy(IProgressMonitor monitor) | |
373 | throws JavaModelException { | |
374 | ||
375 | } | |
376 | ||
377 | @Override | |
378 | public void commitWorkingCopy(boolean force, IProgressMonitor monitor) | |
379 | throws JavaModelException { | |
380 | ||
381 | } | |
382 | ||
383 | @Override | |
384 | public IImportDeclaration createImport(String name, IJavaElement sibling, | |
385 | IProgressMonitor monitor) throws JavaModelException { | |
386 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
387 | } | |
388 | ||
389 | @Override | |
390 | public IImportDeclaration createImport(String name, IJavaElement sibling, | |
391 | int flags, IProgressMonitor monitor) throws JavaModelException { | |
392 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
393 | } | |
394 | ||
395 | @Override | |
396 | public IPackageDeclaration createPackageDeclaration(String name, | |
397 | IProgressMonitor monitor) throws JavaModelException { | |
398 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
399 | } | |
400 | ||
401 | @Override | |
402 | public IType createType(String contents, IJavaElement sibling, | |
403 | boolean force, IProgressMonitor monitor) throws JavaModelException { | |
404 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
405 | } | |
406 | ||
407 | @Override | |
408 | public void discardWorkingCopy() throws JavaModelException { | |
409 | ||
410 | } | |
411 | ||
412 | @Override | |
413 | public IJavaElement[] findElements(IJavaElement element) { | |
414 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
415 | } | |
416 | ||
417 | @Override | |
418 | public ICompilationUnit findWorkingCopy(WorkingCopyOwner owner) { | |
419 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
420 | } | |
421 | ||
422 | @Override | |
423 | public IType[] getAllTypes() throws JavaModelException { | |
424 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
425 | } | |
426 | ||
427 | @Override | |
428 | public IImportDeclaration getImport(String name) { | |
429 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
430 | } | |
431 | ||
432 | @Override | |
433 | public IImportContainer getImportContainer() { | |
434 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
435 | } | |
436 | ||
437 | @Override | |
438 | public IImportDeclaration[] getImports() throws JavaModelException { | |
439 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
440 | } | |
441 | ||
442 | @Override | |
443 | public ICompilationUnit getPrimary() { | |
444 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
445 | } | |
446 | ||
447 | @Override | |
448 | public WorkingCopyOwner getOwner() { | |
449 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
450 | } | |
451 | ||
452 | @Override | |
453 | public IPackageDeclaration getPackageDeclaration(String name) { | |
454 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
455 | } | |
456 | ||
457 | @Override | |
458 | public IPackageDeclaration[] getPackageDeclarations() | |
459 | throws JavaModelException { | |
460 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
461 | } | |
462 | ||
463 | @Override | |
464 | public IType getType(String name) { | |
465 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
466 | } | |
467 | ||
468 | @Override | |
469 | public IType[] getTypes() throws JavaModelException { | |
470 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
471 | } | |
472 | ||
473 | @Override | |
474 | public ICompilationUnit getWorkingCopy(IProgressMonitor monitor) | |
475 | throws JavaModelException { | |
476 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
477 | } | |
478 | ||
479 | @Override | |
480 | public boolean hasResourceChanged() { | |
481 | return false; | |
482 | } | |
483 | ||
484 | @Override | |
485 | public boolean isWorkingCopy() { | |
486 | return false; | |
487 | } | |
488 | ||
489 | @Override | |
490 | public CompilationUnit reconcile(int astLevel, | |
491 | boolean forceProblemDetection, WorkingCopyOwner owner, | |
492 | IProgressMonitor monitor) throws JavaModelException { | |
493 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
494 | } | |
495 | ||
496 | @Override | |
497 | public CompilationUnit reconcile(int astLevel, | |
498 | boolean forceProblemDetection, boolean enableStatementsRecovery, | |
499 | WorkingCopyOwner owner, IProgressMonitor monitor) | |
500 | throws JavaModelException { | |
501 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
502 | } | |
503 | ||
504 | @Override | |
505 | public CompilationUnit reconcile(int astLevel, int reconcileFlags, | |
506 | WorkingCopyOwner owner, IProgressMonitor monitor) | |
507 | throws JavaModelException { | |
508 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
509 | } | |
510 | ||
511 | @Override | |
512 | public void restore() throws JavaModelException { | |
513 | ||
514 | } | |
515 | ||
516 | @Override | |
517 | public ICompilationUnit getWorkingCopy(WorkingCopyOwner owner, | |
518 | IProblemRequestor problemRequestor, IProgressMonitor monitor) | |
519 | throws JavaModelException { | |
520 | throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class); | |
521 | } | |
522 | ||
523 | } |