View Javadoc
1   /*
2    * Copyright 2006 Werner Guttmann
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5    * use this file except in compliance with the License. You may obtain a copy of
6    * 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, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations under
14   * the License.
15   */
16  package org.exolab.javasource;
17  
18  /**
19   * JType sub-class for componentized types, such as array as collections.
20   * 
21   * @author <a href="mailto:werner DOT guttmann AT gmx DOT net">Werner Guttman</a>
22   * @version $Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
23   * @since 1.0.4
24   */
25  public class JComponentizedType extends JType {
26      //--------------------------------------------------------------------------
27  
28      /** Indicates the data type contained in this collection. */
29      private JType _componentType;
30  
31      /** Indicates whether Java 5.0 compliant code is required. */
32      private boolean _useJava50;
33  
34      //--------------------------------------------------------------------------
35  
36      /**
37       * Creates an instance of a componentized type, of type 'name'.
38       * 
39       * @param name Type name for this componentized type.
40       * @param componentType Component type.
41       * @param useJava50 True if Java 5.0 should be used.
42       */
43      protected JComponentizedType(final String name, final JType componentType,
44              final boolean useJava50) {
45          super (name);
46  
47          _componentType = componentType;
48          _useJava50 = useJava50;
49      }
50  
51      //--------------------------------------------------------------------------
52  
53      /**
54       * Returns the component type.
55       * 
56       * @return The component type.
57       */
58      public final JType getComponentType() {
59          return _componentType;
60      }
61  
62      /**
63       * Indicates whether Java 5.0 is used.
64       * 
65       * @return True if Java 5.0 is used.
66       */
67      public final boolean isUseJava50() {
68          return _useJava50;
69      }
70  
71      //--------------------------------------------------------------------------
72  }