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.model.java;
18  
19  /***
20   * This is the super interface for named JavaModel elements having a declaring
21   * class such as JavaField, JavaMethod, etc.
22   * 
23   * @author Michael Bouschen
24   * @since JDO 2.0
25   */
26  public interface JavaMember extends JavaElement 
27  {
28      /***
29       * Returns the name of the member. 
30       * @return member name
31       */
32      public String getName();
33  
34      /***
35       * Returns the JavaType instance representing the class or interface
36       * that declares the member represented by this JavaMember instance.
37       * @return the JavaType instance of the declaring class.
38       */
39      public JavaType getDeclaringClass();
40  
41      /***
42       * Returns the Java language modifiers for the field represented by
43       * this JavaMember, as an integer. The java.lang.reflect.Modifier class
44       * should be used to decode the modifiers. 
45       * @return the Java language modifiers for this JavaMember
46       * @see java.lang.reflect.Modifier
47       */
48      public int getModifiers();
49  
50      /***
51       * Returns the JavaType representation of the type of the member.
52       * @return type of the member
53       */
54      public JavaType getType();
55  
56      /***
57       * Returns the JavaType representation of the component type of the type
58       * of the member, if the field type is an array or collection. The
59       * method returns <code>null</code>, if the member type is not an array
60       * or collection.
61       * @return the component type of the member type in case of an array or
62       * collection.
63       */
64      public JavaType getComponentType();
65  }