org.apache.tomcat.util.bcel.classfile

## Class FieldOrMethod

- java.lang.Object
- - org.apache.tomcat.util.bcel.classfile.AccessFlags
  - - org.apache.tomcat.util.bcel.classfile.FieldOrMethod

All Implemented Interfaces:
  Serializable, Cloneable

Direct Known Subclasses:
  Field, Method

    public abstract class FieldOrMethod
    extends AccessFlags
    implements Cloneable

Abstract super class for fields and methods.

Author:
  M. Dahm
See Also:
  Serialized Form

### Field Summary

Fields
`protected Attribute[]` `attributes`
`protected int` `attributes_count`
`protected ConstantPool` `constant_pool`
`protected int` `name_index`
`protected int` `signature_index`

### Fields inherited from class org.apache.tomcat.util.bcel.classfile.AccessFlags

`access_flags`

### Constructor Summary

Constructors
`protected` `FieldOrMethod(DataInputStream file, ConstantPool constant_pool)` Construct object from file stream.
`protected` `FieldOrMethod(int access_flags, int name_index, int signature_index, Attribute[] attributes, ConstantPool constant_pool)`

### Method Summary

Methods
`String` `getName()`
`String` `getSignature()`
`void` `setAttributes(Attribute[] attributes)`

### Methods inherited from class org.apache.tomcat.util.bcel.classfile.AccessFlags

`getAccessFlags`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### name_index

    protected int name_index

#### signature_index

    protected int signature_index

#### attributes_count

    protected int attributes_count

#### attributes

    protected Attribute[] attributes

#### constant_pool

    protected ConstantPool constant_pool

### Constructor Detail

#### FieldOrMethod

    protected FieldOrMethod(DataInputStream file,
                 ConstantPool constant_pool)
                     throws IOException,
                            ClassFormatException

Construct object from file stream.

Parameters:
  `file` - Input stream
Throws:
  `IOException`
  `ClassFormatException`

#### FieldOrMethod

    protected FieldOrMethod(int access_flags,
                 int name_index,
                 int signature_index,
                 Attribute[] attributes,
                 ConstantPool constant_pool)

Parameters:
  `access_flags` - Access rights of method
  `name_index` - Points to field name in constant pool
  `signature_index` - Points to encoded signature
  `attributes` - Collection of attributes
  `constant_pool` - Array of constants

### Method Detail

#### setAttributes

    public final void setAttributes(Attribute[] attributes)

Parameters:
  `attributes` - Collection of object attributes.

#### getName

    public final String getName()

Returns:
  Name of object, i.e., method name or field name

#### getSignature

    public final String getSignature()

Returns:
  String representation of object's type signature (java style)