1 package no.uio.ifi.refaktor.utils;
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;
30 @SuppressWarnings("deprecation")
31 public class NullCompilationUnit implements ICompilationUnit {
34 public IType findPrimaryType() {
35 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
39 public IJavaElement getElementAt(int position) throws JavaModelException {
40 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
44 public ICompilationUnit getWorkingCopy(WorkingCopyOwner owner,
45 IProgressMonitor monitor) throws JavaModelException {
46 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
50 public boolean exists() {
55 public IJavaElement getAncestor(int ancestorType) {
56 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
60 public String getAttachedJavadoc(IProgressMonitor monitor)
61 throws JavaModelException {
62 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
66 public IResource getCorrespondingResource() throws JavaModelException {
67 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
71 public String getElementName() {
72 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
76 public int getElementType() {
81 public String getHandleIdentifier() {
82 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
86 public IJavaModel getJavaModel() {
87 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
91 public IJavaProject getJavaProject() {
92 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
96 public IOpenable getOpenable() {
97 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
101 public IJavaElement getParent() {
102 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
106 public IPath getPath() {
107 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
111 public IJavaElement getPrimaryElement() {
112 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
116 public IResource getResource() {
117 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
121 public ISchedulingRule getSchedulingRule() {
122 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
126 public IResource getUnderlyingResource() throws JavaModelException {
127 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
131 public boolean isReadOnly() {
136 public boolean isStructureKnown() throws JavaModelException {
141 public Object getAdapter(Class adapter) {
142 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
146 public IJavaElement[] getChildren() throws JavaModelException {
147 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
151 public boolean hasChildren() throws JavaModelException {
156 public void close() throws JavaModelException {
161 public String findRecommendedLineSeparator() throws JavaModelException {
162 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
166 public IBuffer getBuffer() throws JavaModelException {
167 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
171 public boolean hasUnsavedChanges() throws JavaModelException {
176 public boolean isConsistent() throws JavaModelException {
181 public boolean isOpen() {
186 public void makeConsistent(IProgressMonitor progress)
187 throws JavaModelException {
192 public void open(IProgressMonitor progress) throws JavaModelException {
197 public void save(IProgressMonitor progress, boolean force)
198 throws JavaModelException {
203 public String getSource() throws JavaModelException {
204 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
208 public ISourceRange getSourceRange() throws JavaModelException {
209 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
213 public ISourceRange getNameRange() throws JavaModelException {
214 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
218 public void codeComplete(int offset, ICodeCompletionRequestor requestor)
219 throws JavaModelException {
224 public void codeComplete(int offset, ICompletionRequestor requestor)
225 throws JavaModelException {
230 public void codeComplete(int offset, CompletionRequestor requestor)
231 throws JavaModelException {
236 public void codeComplete(int offset, CompletionRequestor requestor,
237 IProgressMonitor monitor) throws JavaModelException {
242 public void codeComplete(int offset, ICompletionRequestor requestor,
243 WorkingCopyOwner owner) throws JavaModelException {
248 public void codeComplete(int offset, CompletionRequestor requestor,
249 WorkingCopyOwner owner) throws JavaModelException {
254 public void codeComplete(int offset, CompletionRequestor requestor,
255 WorkingCopyOwner owner, IProgressMonitor monitor)
256 throws JavaModelException {
261 public IJavaElement[] codeSelect(int offset, int length)
262 throws JavaModelException {
263 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
267 public IJavaElement[] codeSelect(int offset, int length,
268 WorkingCopyOwner owner) throws JavaModelException {
269 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
273 public void commit(boolean force, IProgressMonitor monitor)
274 throws JavaModelException {
279 public void destroy() {
284 public IJavaElement findSharedWorkingCopy(IBufferFactory bufferFactory) {
285 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
289 public IJavaElement getOriginal(IJavaElement workingCopyElement) {
290 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
294 public IJavaElement getOriginalElement() {
295 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
299 public IJavaElement getSharedWorkingCopy(IProgressMonitor monitor,
300 IBufferFactory factory, IProblemRequestor problemRequestor)
301 throws JavaModelException {
302 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
306 public IJavaElement getWorkingCopy() throws JavaModelException {
307 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
311 public IJavaElement getWorkingCopy(IProgressMonitor monitor,
312 IBufferFactory factory, IProblemRequestor problemRequestor)
313 throws JavaModelException {
314 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
318 public boolean isBasedOn(IResource resource) {
323 public IMarker[] reconcile() throws JavaModelException {
324 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
328 public void reconcile(boolean forceProblemDetection,
329 IProgressMonitor monitor) throws JavaModelException {
334 public void copy(IJavaElement container, IJavaElement sibling,
335 String rename, boolean replace, IProgressMonitor monitor)
336 throws JavaModelException {
341 public void delete(boolean force, IProgressMonitor monitor)
342 throws JavaModelException {
347 public void move(IJavaElement container, IJavaElement sibling,
348 String rename, boolean replace, IProgressMonitor monitor)
349 throws JavaModelException {
354 public void rename(String name, boolean replace, IProgressMonitor monitor)
355 throws JavaModelException {
360 public UndoEdit applyTextEdit(TextEdit edit, IProgressMonitor monitor)
361 throws JavaModelException {
362 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
366 public void becomeWorkingCopy(IProblemRequestor problemRequestor,
367 IProgressMonitor monitor) throws JavaModelException {
372 public void becomeWorkingCopy(IProgressMonitor monitor)
373 throws JavaModelException {
378 public void commitWorkingCopy(boolean force, IProgressMonitor monitor)
379 throws JavaModelException {
384 public IImportDeclaration createImport(String name, IJavaElement sibling,
385 IProgressMonitor monitor) throws JavaModelException {
386 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
390 public IImportDeclaration createImport(String name, IJavaElement sibling,
391 int flags, IProgressMonitor monitor) throws JavaModelException {
392 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
396 public IPackageDeclaration createPackageDeclaration(String name,
397 IProgressMonitor monitor) throws JavaModelException {
398 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
402 public IType createType(String contents, IJavaElement sibling,
403 boolean force, IProgressMonitor monitor) throws JavaModelException {
404 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
408 public void discardWorkingCopy() throws JavaModelException {
413 public IJavaElement[] findElements(IJavaElement element) {
414 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
418 public ICompilationUnit findWorkingCopy(WorkingCopyOwner owner) {
419 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
423 public IType[] getAllTypes() throws JavaModelException {
424 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
428 public IImportDeclaration getImport(String name) {
429 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
433 public IImportContainer getImportContainer() {
434 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
438 public IImportDeclaration[] getImports() throws JavaModelException {
439 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
443 public ICompilationUnit getPrimary() {
444 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
448 public WorkingCopyOwner getOwner() {
449 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
453 public IPackageDeclaration getPackageDeclaration(String name) {
454 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
458 public IPackageDeclaration[] getPackageDeclarations()
459 throws JavaModelException {
460 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
464 public IType getType(String name) {
465 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
469 public IType[] getTypes() throws JavaModelException {
470 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
474 public ICompilationUnit getWorkingCopy(IProgressMonitor monitor)
475 throws JavaModelException {
476 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
480 public boolean hasResourceChanged() {
485 public boolean isWorkingCopy() {
490 public CompilationUnit reconcile(int astLevel,
491 boolean forceProblemDetection, WorkingCopyOwner owner,
492 IProgressMonitor monitor) throws JavaModelException {
493 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
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);
505 public CompilationUnit reconcile(int astLevel, int reconcileFlags,
506 WorkingCopyOwner owner, IProgressMonitor monitor)
507 throws JavaModelException {
508 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);
512 public void restore() throws JavaModelException {
517 public ICompilationUnit getWorkingCopy(WorkingCopyOwner owner,
518 IProblemRequestor problemRequestor, IProgressMonitor monitor)
519 throws JavaModelException {
520 throw new UnsupportedNullObjectOperationException(NullCompilationUnit.class);