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