KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > core > ITypeParameter


1 /*******************************************************************************
2  * Copyright (c) 2004, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.core;
12
13
14 /**
15  * Represents a type parameter defined by a type of a method
16  * in a compilation unit or a class file.
17  * <p>
18  * Type parameters are obtained using {@link IType#getTypeParameter(String)} and
19  * {@link IMethod#getTypeParameter(String)}.
20  * </p><p>
21  * Note that type parameters are not children of their declaring type or method. To get a list
22  * of the type parameters use {@link IType#getTypeParameters()} for a type and use
23  * {@link IMethod#getTypeParameters()} for a method.
24  * </p>
25  * <p>
26  * This interface is not intended to be implemented by clients.
27  * </p>
28  *
29  * @since 3.1
30  */

31 public interface ITypeParameter extends IJavaElement, ISourceReference {
32
33     /**
34      * Returns the names of the class and interface bounds of this type parameter. Returns an empty
35      * array if this type parameter has no bounds. A bound name is the name as it appears in the
36      * source (without the <code>extends</code> keyword) if the type parameter comes from a
37      * compilation unit. It is the dot-separated fully qualified name of the bound if the type
38      * parameter comes from a class file.
39      *
40      * @return the names of the bounds
41      * @throws JavaModelException if this element does not exist or if an
42      * exception occurs while accessing its corresponding resource
43      */

44     String JavaDoc[] getBounds() throws JavaModelException;
45     
46     /**
47      * Returns the declaring member of this type parameter. This can be either an <code>IType</code>
48      * or an <code>IMethod</code>.
49      * <p>
50      * This is a handle-only method.
51      * </p>
52      *
53      * @return the declaring member of this type parameter.
54      */

55     IMember getDeclaringMember();
56     
57     /**
58      * Returns the source range of this type parameter's name,
59      * or <code>null</code> if this type parameter does not have
60      * associated source code (for example, in a binary type).
61      *
62      * @exception JavaModelException if this element does not exist or if an
63      * exception occurs while accessing its corresponding resource.
64      * @return the source range of this type parameter's name,
65      * or <code>null</code> if this type parameter does not have
66      * associated source code (for example, in a binary type)
67      */

68     ISourceRange getNameRange() throws JavaModelException;
69 }
70
Popular Tags