0N/A/*
553N/A * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
553N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
553N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
553N/A * or visit www.oracle.com if you need additional information or have any
553N/A * questions.
0N/A */
0N/A
0N/Apackage com.sun.javadoc;
0N/A
0N/A/**
0N/A * Represents a type. A type can be a class or interface, an
0N/A * invocation (like {@code List<String>}) of a generic class or interface,
0N/A * a type variable, a wildcard type ("<code>?</code>"),
0N/A * or a primitive data type (like <code>char</code>).
0N/A *
0N/A * @since 1.2
0N/A * @author Kaiyang Liu (original)
0N/A * @author Robert Field (rewrite)
0N/A * @author Scott Seligman (generics)
0N/A */
0N/Apublic interface Type {
0N/A
0N/A /**
0N/A * Return unqualified name of type excluding any dimension information.
0N/A * <p>
0N/A * For example, a two dimensional array of String returns
0N/A * "<code>String</code>".
0N/A */
0N/A String typeName();
0N/A
0N/A /**
0N/A * Return qualified name of type excluding any dimension information.
0N/A *<p>
0N/A * For example, a two dimensional array of String
0N/A * returns "<code>java.lang.String</code>".
0N/A */
0N/A String qualifiedTypeName();
0N/A
0N/A /**
0N/A * Return the simple name of this type excluding any dimension information.
0N/A * This is the unqualified name of the type, except that for nested types
0N/A * only the identifier of the innermost type is included.
0N/A * <p>
0N/A * For example, the class {@code Outer.Inner} returns
0N/A * "<code>Inner</code>".
0N/A *
0N/A * @since 1.5
0N/A */
0N/A String simpleTypeName();
0N/A
0N/A /**
0N/A * Return the type's dimension information, as a string.
0N/A * <p>
0N/A * For example, a two dimensional array of String returns
0N/A * "<code>[][]</code>".
0N/A */
0N/A String dimension();
0N/A
0N/A /**
0N/A * Return a string representation of the type.
0N/A * This includes any dimension information and type arguments.
0N/A * <p>
0N/A * For example, a two dimensional array of String may return
0N/A * "<code>java.lang.String[][]</code>",
0N/A * and the parameterized type {@code List<Integer>} may return
0N/A * "{@code java.util.List<java.lang.Integer>}".
0N/A *
0N/A * @return a string representation of the type.
0N/A */
0N/A String toString();
0N/A
0N/A /**
0N/A * Return true if this type represents a primitive type.
0N/A *
0N/A * @return true if this type represents a primitive type.
0N/A * @since 1.5
0N/A */
0N/A boolean isPrimitive();
0N/A
0N/A /**
0N/A * Return this type as a <code>ClassDoc</code> if it represents a class
0N/A * or interface. Array dimensions are ignored.
0N/A * If this type is a <code>ParameterizedType</code>,
0N/A * <code>TypeVariable</code>, or <code>WildcardType</code>, return
0N/A * the <code>ClassDoc</code> of the type's erasure. If this is an
0N/A * <code>AnnotationTypeDoc</code>, return this as a <code>ClassDoc</code>
0N/A * (but see {@link #asAnnotationTypeDoc()}).
0N/A * If this is a primitive type, return null.
0N/A *
0N/A * @return the <code>ClassDoc</code> of this type,
0N/A * or null if it is a primitive type.
0N/A */
0N/A ClassDoc asClassDoc();
0N/A
0N/A /**
0N/A * Return this type as a <code>ParameterizedType</code> if it represents
0N/A * an invocation of a generic class or interface. Array dimensions
0N/A * are ignored.
0N/A *
0N/A * @return a <code>ParameterizedType</code> if the type is an
0N/A * invocation of a generic type, or null if it is not.
0N/A * @since 1.5
0N/A */
0N/A ParameterizedType asParameterizedType();
0N/A
0N/A /**
0N/A * Return this type as a <code>TypeVariable</code> if it represents
0N/A * a type variable. Array dimensions are ignored.
0N/A *
0N/A * @return a <code>TypeVariable</code> if the type is a type variable,
0N/A * or null if it is not.
0N/A * @since 1.5
0N/A */
0N/A TypeVariable asTypeVariable();
0N/A
0N/A /**
0N/A * Return this type as a <code>WildcardType</code> if it represents
0N/A * a wildcard type.
0N/A *
0N/A * @return a <code>WildcardType</code> if the type is a wildcard type,
0N/A * or null if it is not.
0N/A * @since 1.5
0N/A */
0N/A WildcardType asWildcardType();
0N/A
0N/A /**
0N/A * Return this type as an <code>AnnotationTypeDoc</code> if it represents
0N/A * an annotation type. Array dimensions are ignored.
0N/A *
0N/A * @return an <code>AnnotationTypeDoc</code> if the type is an annotation
0N/A * type, or null if it is not.
0N/A * @since 1.5
0N/A */
0N/A AnnotationTypeDoc asAnnotationTypeDoc();
0N/A}