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