View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software 
12   * distributed under the License is distributed on an "AS IS" BASIS, 
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
14   * See the License for the specific language governing permissions and 
15   * limitations under the License.
16   */
17  
18  package org.apache.jdo.impl.model.java;
19  
20  import org.apache.jdo.model.java.JavaType;
21  
22  /***
23   * A WrapperClassType instance represents a Java wrapper class type. 
24   * There are eight Java wrapper class types: 
25   * <code>java.lang.Boolean</code>, <code>java.lang.Byte</code>, 
26   * <code>java.lang.Short</code>, <code>java.lang.Integer</code>, 
27   * <code>java.lang.Long</code>, <code>java.lang.Character</code>, 
28   * <code>java.lang.Float</code>, <code>java.lang.Double</code>.
29   * 
30   * <p>
31   * Class PredefinedType provides public static final variables referring
32   * to the JavaType representation for wrapper class types.
33   * 
34   * @see PredefinedType#booleanClassType
35   * @see PredefinedType#byteClassType
36   * @see PredefinedType#shortClassType
37   * @see PredefinedType#integerClassType
38   * @see PredefinedType#longClassType 
39   * @see PredefinedType#characterClassType
40   * @see PredefinedType#floatClassType
41   * @see PredefinedType#doubleClassType 
42   *
43   * @author Michael Bouschen
44   * @since JDO 1.0.1
45   */
46  public class WrapperClassType 
47      extends ValueClassType
48  {
49      /*** */
50      private PrimitiveType wrappedPrimitiveType;
51  
52      /*** */
53      protected WrapperClassType(Class clazz, JavaType superclass, boolean orderable)
54      {
55          super(clazz, superclass, orderable);
56      }
57  
58      /*** */
59      public boolean isWrapperClass()
60      {
61          return true;
62      }
63  
64      // ===== Methods not defined in JavaType =====
65  
66      /*** */
67      public PrimitiveType getWrappedPrimitiveType()
68      {
69          return wrappedPrimitiveType;
70      }
71      
72      /*** */
73      void setWrappedPrimitiveType(PrimitiveType wrappedPrimitiveType)
74      {
75          this.wrappedPrimitiveType = wrappedPrimitiveType;
76      }
77      
78  }