Member.java revision f6c387128427e121477c1b32ad35cdcaa5101ba3
1/*
2 * Copyright (C) 2007 The Android Open Source Project
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
17package com.android.dx.cf.iface;
18
19import com.android.dx.rop.cst.CstNat;
20import com.android.dx.rop.cst.CstType;
21import com.android.dx.rop.cst.CstUtf8;
22
23/**
24 * Interface representing members of class files (that is, fields and methods).
25 */
26public interface Member {
27    /**
28     * Get the defining class.
29     *
30     * @return non-null; the defining class
31     */
32    public CstType getDefiningClass();
33
34    /**
35     * Get the field <code>access_flags</code>.
36     *
37     * @return the access flags
38     */
39    public int getAccessFlags();
40
41    /**
42     * Get the field <code>name_index</code> of the member. This is
43     * just a convenient shorthand for <code>getNat().getName()</code>.
44     *
45     * @return non-null; the name
46     */
47    public CstUtf8 getName();
48
49    /**
50     * Get the field <code>descriptor_index</code> of the member. This is
51     * just a convenient shorthand for <code>getNat().getDescriptor()</code>.
52     *
53     * @return non-null; the descriptor
54     */
55    public CstUtf8 getDescriptor();
56
57    /**
58     * Get the name and type associated with this member. This is a
59     * combination of the fields <code>name_index</code> and
60     * <code>descriptor_index</code> in the original classfile, interpreted
61     * via the constant pool.
62     *
63     * @return non-null; the name and type
64     */
65    public CstNat getNat();
66
67    /**
68     * Get the field <code>attributes</code> (along with
69     * <code>attributes_count</code>).
70     *
71     * @return non-null; the constant pool
72     */
73    public AttributeList getAttributes();
74}
75