Tue, 09 Oct 2012 19:10:00 -0700
8000663: clean up langtools imports
Reviewed-by: darcy
1 /*
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
26 package com.sun.tools.javadoc;
28 import com.sun.javadoc.*;
30 import com.sun.tools.javac.code.Type;
33 /**
34 * Abstract implementation of <code>Type</code>, with useful
35 * defaults for the methods in <code>Type</code> (and a couple from
36 * <code>ProgramElementDoc</code>).
37 *
38 * @author Scott Seligman
39 * @since 1.5
40 */
41 abstract class AbstractTypeImpl implements com.sun.javadoc.Type {
43 protected final DocEnv env;
44 protected final Type type;
46 protected AbstractTypeImpl(DocEnv env, Type type) {
47 this.env = env;
48 this.type = type;
49 }
51 public String typeName() {
52 return type.tsym.name.toString();
53 }
55 public String qualifiedTypeName() {
56 return type.tsym.getQualifiedName().toString();
57 }
59 public String simpleTypeName() {
60 return type.tsym.name.toString();
61 }
63 public String name() {
64 return typeName();
65 }
67 public String qualifiedName() {
68 return qualifiedTypeName();
69 }
71 public String toString() {
72 return qualifiedTypeName();
73 }
75 public String dimension() {
76 return "";
77 }
79 public boolean isPrimitive() {
80 return false;
81 }
83 public ClassDoc asClassDoc() {
84 return null;
85 }
87 public TypeVariable asTypeVariable() {
88 return null;
89 }
91 public WildcardType asWildcardType() {
92 return null;
93 }
95 public ParameterizedType asParameterizedType() {
96 return null;
97 }
99 public AnnotationTypeDoc asAnnotationTypeDoc() {
100 return null;
101 }
102 }