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