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 JDOSupportedMapType instance represents a JDO supported map type. 
23   * <p>
24   * Class PredefinedType provides public static final variables referring
25   * to the JavaType representation for JDO supported map types.
26   *
27   * @see PredefinedType#mapType
28   * @see PredefinedType#hashMapType
29   * @see PredefinedType#hashtableType
30   * @see PredefinedType#propertiesType
31   * @see PredefinedType#treeMapType
32   *
33   * @author Michael Bouschen
34   * @since JDO 1.0.1
35   */
36  public class JDOSupportedMapType
37      extends PredefinedType
38  {
39      /*** 
40       * Constructor for JDOSupportedMap types having no superclass. This is
41       * the map interface among the JDO supported map types.
42       * @param clazz the Class instance representing the type
43       */
44      public JDOSupportedMapType(Class clazz)
45      {
46          super(clazz);
47      }
48  
49      /*** 
50       * Constructor for JDOSupportedMap types having a superclass. These are
51       * the map implemenatation classes among the JDO supported map types.
52       * @param clazz the Class instance representing the type
53       * @param superclass JavaType instance representing the superclass.
54       */
55      public JDOSupportedMapType(Class clazz, JavaType superclass)
56      {
57          super(clazz, superclass);
58      }
59  
60      /*** 
61       * Returns <code>true</code> if this JavaType represents a JDO
62       * supported map type. The JDO specification allows the
63       * following map interfaces and classes as types of persistent 
64       * fields (see section 6.4.3 Persistent fields):
65       * @return <code>true</code> if this JavaTypre represents a JDO
66       * supported map; <code>false</code> otherwise.
67       */
68      public boolean isJDOSupportedMap() 
69      {
70          return true;
71      }
72  
73      /***
74       * Returns <code>true</code> if this JavaType represents a trackable
75       * Java class. A JDO implementation may replace a persistent field of
76       * a trackable type with an assignment compatible instance of its own
77       * implementation of this type which notifies the owning FCO of any
78       * change of this field. 
79       * @return <code>true</code> if this JavaType represents a trackable
80       * Java class, <code>false</code> otherwise.
81       */
82      public boolean isTrackable()
83      {
84          return true;
85      }
86      
87  }