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.codehaus.modello.plugin.java.javasource;
17  
18  /**
19   * JType sub-class for Arrays.
20   *
21   * @author Werner Guttman
22   * @version $Revision$ $Date$
23   * @since 1.0.4
24   */
25  public final class JArrayType extends JComponentizedType {
26      // --------------------------------------------------------------------------
27  
28      /**
29       * Creates an instance of a array type, of type 'name'.
30       *
31       * @param componentType Component type.
32       */
33      public JArrayType(final JType componentType) {
34          super(componentType.getName(), componentType);
35      }
36  
37      // --------------------------------------------------------------------------
38  
39      /**
40       * Returns the String representation of this JType, which is simply the name of this type.
41       *
42       * @return The String representation of this JType.
43       */
44      public String toString() {
45          return getComponentType().toString() + "[]";
46      }
47  
48      // --------------------------------------------------------------------------
49  }