Home | History | Annotate | Download | only in model
      1 /*
      2  * Copyright (C) 2009 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package signature.model;
     18 
     19 import java.util.List;
     20 
     21 /**
     22  * {@code IParameterizedType} models a parameterized type. A parameterized type
     23  * instantiates a generic class definition with actual type arguments.
     24  *
     25  * <pre>
     26  * IClassDefinition:
     27  * public class A<T> {}
     28  *
     29  * public class XXX {
     30  * IParameterizedType (raw type: A , type arguments: Number)
     31  *   public A<Number> fields;
     32  * }
     33  * </pre>
     34  */
     35 public interface IParameterizedType extends ITypeReference {
     36 
     37     /**
     38      * Returns the actual type arguments of this parameterized type.
     39      *
     40      * @return the actual type arguments of this parameterized type
     41      */
     42     List<ITypeReference> getTypeArguments();
     43 
     44     /**
     45      * Returns the raw type of this parameterized type.
     46      *
     47      * @return the raw type of this parameterized type
     48      */
     49     IClassReference getRawType();
     50 
     51     /**
     52      * Returns the owner type of this parameterized type or {@code null}.
     53      *
     54      * <pre>
     55      * class Y&lt;T&gt; {
     56      *     class Z&lt;S&gt; {
     57      *     }
     58      *
     59      *     Y&lt;Integer&gt;.Z&lt;String&gt; a;
     60      * }
     61      * </pre>
     62      */
     63     ITypeReference getOwnerType(); // A.B<String> -> A
     64 }
     65