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  /*
19   * RegisterClassEvent.java
20   *
21   */
22  
23  package javax.jdo.spi;
24  
25  import java.util.EventObject;
26  
27  /**
28   * A <code>RegisterClassEvent</code> event gets delivered whenever a persistence-capable
29   * class registers itself with the <code>JDOImplHelper</code>.
30   *
31   * @version 1.0
32   */
33  public class RegisterClassEvent 
34      extends EventObject
35  {
36      /** The class object of the registered persistence-capable class */
37      protected Class pcClass;
38  
39      /** The names of managed fields of the persistence-capable class */
40      protected String[] fieldNames;  
41  
42      /** The types of managed fields of the persistence-capable class */
43      protected Class[] fieldTypes;
44  
45      /** The flags of managed fields of the persistence-capable class */
46      protected byte[] fieldFlags;
47  
48      /** */
49      protected Class persistenceCapableSuperclass; 
50  
51      /** 
52       * Constructs a new <code>RegisterClassEvent</code>.
53       * @param helper the <code>JDOImplHelper</code> instance
54       * @param registeredClass the persistence-capable class
55       * @param fieldNames the names of the managed fields
56       * @param fieldTypes the types of the managed fields
57       * @param fieldFlags the flags of the managed fields
58       * @param persistenceCapableSuperclass the persistence-capable superclass
59       **/
60      public RegisterClassEvent(JDOImplHelper helper,
61                                Class registeredClass, 
62                                String[] fieldNames, 
63                                Class[] fieldTypes,
64                                byte[] fieldFlags,
65                                Class persistenceCapableSuperclass)
66      {
67          super(helper);
68          this.pcClass = registeredClass;
69          this.fieldNames = fieldNames;
70          this.fieldTypes = fieldTypes;
71          this.fieldFlags = fieldFlags;
72          this.persistenceCapableSuperclass = persistenceCapableSuperclass;
73      }
74  
75      /**
76       * Returns the class object of the registered persistence-capable class.
77       * @return the persistence-capable class.
78       */
79      public Class getRegisteredClass()
80      {
81          return pcClass;
82      }
83      
84      /**    
85       * Returns the names of the managed field of the persistence-capable class.
86       * @return the names of the managed fields
87       */
88      public String[] getFieldNames()
89      {
90          return fieldNames;
91      }
92  
93      /**
94       * Returns the types of the managed field of the persistence-capable class.
95       * @return the types of the managed fields
96       */
97      public Class[] getFieldTypes()
98      {
99          return fieldTypes;
100     }
101 
102     /**
103      * Returns the flags of the managed field of the persistence-capable class.
104      * @return the flags of the managed fields
105      */
106     public byte[] getFieldFlags()
107     {
108         return fieldFlags;
109     }
110 
111     /**
112      * Returns the class object of the persistence-capable superclass.
113      * @return the persistence-capable superclass.
114      */
115     public Class getPersistenceCapableSuperclass()
116     {
117         return persistenceCapableSuperclass;
118     }
119     
120 }
121 
122 
123