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.enhancer.meta.model;
18  
19  import org.apache.jdo.impl.enhancer.meta.EnhancerMetaDataFatalError;
20  import org.apache.jdo.impl.model.java.reflection.ReflectionJavaType;
21  import org.apache.jdo.model.java.JavaModel;
22  import org.apache.jdo.model.java.JavaType;
23  import org.apache.jdo.model.jdo.JDOModel;
24  
25  /***
26   * Provides some basic Java type information based on JVM descriptors.
27   * 
28   * @author Michael Bouschen
29   * @since JDO 1.0.1
30   */
31  public class EnhancerJavaType
32      extends ReflectionJavaType
33  {
34      /***
35       * Creates an instance.
36       */
37      public EnhancerJavaType(Class clazz, EnhancerJavaModel declaringJavaModel)
38      {
39          super(clazz, declaringJavaModel);
40      }
41      
42      // ===== Methods not defined in JavaType =====
43  
44      /*** 
45       * Returns a JavaType instance for the specified Class object. 
46       * <p>
47       * This implementation delegates the call to the declaringJavaModel.
48       * @param clazz the Class instance representing the type
49       * @return a JavaType instance for the name of the specified class
50       * object or <code>null</code> if not present in this model instance.
51       */
52      public JavaType getJavaTypeForClass(Class clazz)
53      {
54          return declaringJavaModel.getJavaType(clazz.getName());
55      }
56      
57  }