1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.jdo.impl.model.java;
19
20 import org.apache.jdo.model.java.JavaType;
21
22 /***
23 * A JDOSupportedCollectionType instance represents a JDO supported
24 * collection type.
25 * <p>
26 * Class PredefinedType provides public static final variables referring
27 * to the JavaType representation for JDO supported map types.
28 *
29 * @see PredefinedType#collectionType
30 * @see PredefinedType#setType
31 * @see PredefinedType#listType
32 * @see PredefinedType#hashSetType
33 * @see PredefinedType#treeSetType
34 * @see PredefinedType#arrayListType
35 * @see PredefinedType#linkedListType
36 * @see PredefinedType#vectorType
37 * @see PredefinedType#stackType
38 *
39 * @author Michael Bouschen
40 * @since JDO 1.0.1
41 */
42 public class JDOSupportedCollectionType
43 extends PredefinedType
44 {
45 /***
46 * Constructor for JDOSupportedCollection types having no superclass.
47 * These are the collection interfaces among the JDO supported
48 * collection types.
49 * @param clazz the Class instance representing the type.
50 */
51 public JDOSupportedCollectionType(Class clazz)
52 {
53 super(clazz);
54 }
55
56 /***
57 * Constructor for JDOSupportedCollection types having a superclass.
58 * These are the collection implemenatation classes among the JDO
59 * supported collection types.
60 * @param clazz the Class instance representing the type
61 * @param superclass JavaType instance representing the superclass.
62 */
63 public JDOSupportedCollectionType(Class clazz, JavaType superclass)
64 {
65 super(clazz, superclass);
66 }
67
68 /***
69 * Returns <code>true</code> if this JavaType represents a JDO
70 * supported collection type. The JDO specification allows the
71 * following collection interfaces and classes as types of persistent
72 * fields (see section 6.4.3 Persistent fields):
73 * @return <code>true</code> if this JavaType represents a JDO
74 * supported collection; <code>false</code> otherwise.
75 */
76 public boolean isJDOSupportedCollection()
77 {
78 return true;
79 }
80
81 /***
82 * Returns <code>true</code> if this JavaType represents a trackable
83 * Java class. A JDO implementation may replace a persistent field of
84 * a trackable type with an assignment compatible instance of its own
85 * implementation of this type which notifies the owning FCO of any
86 * change of this field.
87 * @return <code>true</code> if this JavaType represents a trackable
88 * Java class, <code>false</code> otherwise.
89 */
90 public boolean isTrackable()
91 {
92 return true;
93 }
94
95 }