added -J option to preserve unmodified files in preexisting jarfile
[org.ibex.tool.git] / src / org / eclipse / jdt / internal / compiler / ast / ImplicitDocTypeReference.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package org.eclipse.jdt.internal.compiler.ast;
12
13 import org.eclipse.jdt.internal.compiler.ASTVisitor;
14 import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
15 import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
16 import org.eclipse.jdt.internal.compiler.lookup.Scope;
17 import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
18
19 public class ImplicitDocTypeReference extends TypeReference {
20         
21         public char[] token;
22
23         public ImplicitDocTypeReference(char[] name, int pos) {
24                 super();
25                 this.token = name;
26                 this.sourceStart = pos;
27                 this.sourceEnd = pos;
28         }
29         /* (non-Javadoc)
30          * @see org.eclipse.jdt.internal.compiler.ast.TypeReference#copyDims(int)
31          */
32         public TypeReference copyDims(int dim) {
33                 return null;
34         }
35         /* (non-Javadoc)
36          * @see org.eclipse.jdt.internal.compiler.ast.TypeReference#getTypeBinding(org.eclipse.jdt.internal.compiler.lookup.Scope)
37          */
38         protected TypeBinding getTypeBinding(Scope scope) {
39                 this.constant = NotAConstant;
40                 return this.resolvedType = scope.enclosingSourceType();
41         }
42         /* (non-Javadoc)
43          * @see org.eclipse.jdt.internal.compiler.ast.TypeReference#getTypeName()
44          */
45         public char[][] getTypeName() {
46                 if (this.token != null) {
47                         char[][] tokens = { this.token };
48                         return tokens;
49                 }
50                 return null;
51         }
52         public boolean isThis() {
53                 return true;
54         }
55         /* (non-Javadoc)
56          * @see org.eclipse.jdt.internal.compiler.ast.TypeReference#traverse(org.eclipse.jdt.internal.compiler.ASTVisitor, org.eclipse.jdt.internal.compiler.lookup.BlockScope)
57          */
58         public void traverse(ASTVisitor visitor, BlockScope classScope) {
59                 // Do nothing
60         }
61         /* (non-Javadoc)
62          * @see org.eclipse.jdt.internal.compiler.ast.TypeReference#traverse(org.eclipse.jdt.internal.compiler.ASTVisitor, org.eclipse.jdt.internal.compiler.lookup.ClassScope)
63          */
64         public void traverse(ASTVisitor visitor, ClassScope classScope) {
65                 // Do nothing
66         }
67         /* (non-Javadoc)
68          * @see org.eclipse.jdt.internal.compiler.ast.Expression#printExpression(int, java.lang.StringBuffer)
69          */
70         public StringBuffer printExpression(int indent, StringBuffer output) {
71                 return new StringBuffer();
72         }
73 }