001: /*
002: * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.tools.javadoc;
027:
028: import com.sun.javadoc.*;
029:
030: import com.sun.tools.javac.code.Type;
031:
032: /**
033: * Abstract implementation of <code>Type</code>, with useful
034: * defaults for the methods in <code>Type</code> (and a couple from
035: * <code>ProgramElementDoc</code>).
036: *
037: * @author Scott Seligman
038: * @version 1.11 07/05/05
039: * @since 1.5
040: */
041: abstract class AbstractTypeImpl implements com.sun.javadoc.Type {
042:
043: protected final DocEnv env;
044: protected final Type type;
045:
046: protected AbstractTypeImpl(DocEnv env, Type type) {
047: this .env = env;
048: this .type = type;
049: }
050:
051: public String typeName() {
052: return type.tsym.name.toString();
053: }
054:
055: public String qualifiedTypeName() {
056: return type.tsym.getQualifiedName().toString();
057: }
058:
059: public String simpleTypeName() {
060: return type.tsym.name.toString();
061: }
062:
063: public String name() {
064: return typeName();
065: }
066:
067: public String qualifiedName() {
068: return qualifiedTypeName();
069: }
070:
071: public String toString() {
072: return qualifiedTypeName();
073: }
074:
075: public String dimension() {
076: return "";
077: }
078:
079: public boolean isPrimitive() {
080: return false;
081: }
082:
083: public ClassDoc asClassDoc() {
084: return null;
085: }
086:
087: public TypeVariable asTypeVariable() {
088: return null;
089: }
090:
091: public WildcardType asWildcardType() {
092: return null;
093: }
094:
095: public ParameterizedType asParameterizedType() {
096: return null;
097: }
098:
099: public AnnotationTypeDoc asAnnotationTypeDoc() {
100: return null;
101: }
102: }
|