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;
18  
19  
20  /***
21   * Provides extended JDO meta information for byte-code enhancement.
22   */
23  public interface ExtendedMetaData
24         extends EnhancerMetaData
25  {
26      /***
27       *  Gets all known classnames.
28       *
29       *  @return  All known classnames.
30       */
31      String[] getKnownClasses()
32          throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError;    
33  
34      /***
35       *  Gets the modifiers of a class. The return value is a constant of the
36       *  <code>java.lang.reflect.Modifier</code> class.
37       *
38       *  @param  classname  The classname.
39       *  @return  The modifiers.
40       *  @see  java.lang.reflect.Modifier
41       */
42      int getClassModifiers(String classname)
43          throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError;
44  
45      /***
46       * Returns the name of the superclass of a class.
47       * <P>
48       * @param classPath the JVM-qualified name of the class 
49       * @return the name of the superclass or null if there is none
50       */
51      String getSuperClass(String classPath)
52          throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError;
53  
54      /***
55       *  Gets all known fieldnames of a class.
56       *
57       *  @param  classname  The classname.
58       *  @return  All known fieldnames.
59       */
60      String[] getKnownFields(String classname)
61          throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError;
62  
63      /***
64       *  Gets the type of a field.
65       *
66       *  @param  classname  The classname.
67       *  @param  fieldname  The fieldname.
68       *  @return  The type of the field.
69       */
70      String getFieldType(String classname,
71                          String fieldname)
72          throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError;
73  
74      /***
75       *  Gets the modifiers of a field. The return value is a constant of the
76       *  <code>java.lang.reflect.Modifier</code> class.
77       *
78       *  @param  classname  The classname.
79       *  @param  fieldname  The fieldname.
80       *  @return  The modifiers.
81       *  @see  java.lang.reflect.Modifier
82       */
83      int getFieldModifiers(String classname,
84                            String fieldname)
85          throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError;
86  
87      // convenience methods
88  
89      /***
90       *  Gets the type of some fields.
91       *
92       *  @param  classname  The classname.
93       *  @param  fieldnames  The fieldnames.
94       *  @return  The type of the fields.
95       */
96      String[] getFieldType(String classname,
97                            String[] fieldnames)
98          throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError;
99  
100     /***
101      *  Gets the modifiers of some fields.
102      *
103      *  @param  classname  The classname.
104      *  @param  fieldnames  The fieldnames.
105      *  @return  The modifiers.
106      *  @see  java.lang.reflect.Modifier
107      */
108     int[] getFieldModifiers(String classname,
109                             String[] fieldnames)
110         throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError;
111 }