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