View Javadoc

1   /*
2    * Copyright 2005 The Apache Software Foundation.
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 org.apache.jdo.impl.model.java;
18  
19  import org.apache.jdo.model.java.JavaType;
20  
21  /***
22   * A WrapperClassType instance represents a Java wrapper class type. 
23   * There are eight Java wrapper class types: 
24   * <code>java.lang.Boolean</code>, <code>java.lang.Byte</code>, 
25   * <code>java.lang.Short</code>, <code>java.lang.Integer</code>, 
26   * <code>java.lang.Long</code>, <code>java.lang.Character</code>, 
27   * <code>java.lang.Float</code>, <code>java.lang.Double</code>.
28   * 
29   * <p>
30   * Class PredefinedType provides public static final variables referring
31   * to the JavaType representation for wrapper class types.
32   * 
33   * @see PredefinedType#booleanClassType
34   * @see PredefinedType#byteClassType
35   * @see PredefinedType#shortClassType
36   * @see PredefinedType#integerClassType
37   * @see PredefinedType#longClassType 
38   * @see PredefinedType#characterClassType
39   * @see PredefinedType#floatClassType
40   * @see PredefinedType#doubleClassType 
41   *
42   * @author Michael Bouschen
43   * @since JDO 1.0.1
44   */
45  public class WrapperClassType 
46      extends ValueClassType
47  {
48      /*** */
49      private PrimitiveType wrappedPrimitiveType;
50  
51      /*** */
52      protected WrapperClassType(Class clazz, JavaType superclass, boolean orderable)
53      {
54          super(clazz, superclass, orderable);
55      }
56  
57      /*** */
58      public boolean isWrapperClass()
59      {
60          return true;
61      }
62  
63      // ===== Methods not defined in JavaType =====
64  
65      /*** */
66      public PrimitiveType getWrappedPrimitiveType()
67      {
68          return wrappedPrimitiveType;
69      }
70      
71      /*** */
72      void setWrappedPrimitiveType(PrimitiveType wrappedPrimitiveType)
73      {
74          this.wrappedPrimitiveType = wrappedPrimitiveType;
75      }
76      
77  }