Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.bcel.classfile
Class FieldOrMethod

    java.lang.Object
      |
      +--org.apache.bcel.classfile.AccessFlags
            |
            +--org.apache.bcel.classfile.FieldOrMethod

All Implemented Interfaces:
  java.lang.Cloneable, Node, java.io.Serializable

Direct Known Subclasses:
  Field, Method

public abstract class FieldOrMethod
extends AccessFlags
implements java.lang.Cloneable, Node

Abstract super class for fields and methods.

Version:
  $Id: FieldOrMethod.java,v 1.3 2002/04/24 11:01:30 mdahm Exp $
Author:
  M. Dahm
See Also:
  Serialized Form

Field Summary
`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.bcel.classfile.AccessFlags
`access_flags`

Constructor Summary
`protected` | `FieldOrMethod(java.io.DataInputStream file, ConstantPool constant_pool)` Construct object from file stream.
`protected` | `FieldOrMethod(FieldOrMethod c)` Initialize from another object.
`protected` | `FieldOrMethod(int access_flags, int name_index, int signature_index, Attribute[] attributes, ConstantPool constant_pool)`

Method Summary
`protected FieldOrMethod` | `copy_(ConstantPool constant_pool)`
`void` | `dump(java.io.DataOutputStream file)` Dump object to file stream on binary format.
`Attribute[]` | `getAttributes()`
`ConstantPool` | `getConstantPool()`
`java.lang.String` | `getName()`
`int` | `getNameIndex()`
`java.lang.String` | `getSignature()`
`int` | `getSignatureIndex()`
`void` | `setAttributes(Attribute[] attributes)`
`void` | `setConstantPool(ConstantPool constant_pool)`
`void` | `setNameIndex(int name_index)`
`void` | `setSignatureIndex(int signature_index)`

Methods inherited from class org.apache.bcel.classfile.AccessFlags
`getAccessFlags, getModifiers, isAbstract, isAbstract, isFinal, isFinal, isInterface, isInterface, isNative, isNative, isPrivate, isPrivate, isProtected, isProtected, isPublic, isPublic, isStatic, isStatic, isStrictfp, isStrictfp, isSynchronized, isSynchronized, isTransient, isTransient, isVolatile, isVolatile, setAccessFlags, setModifiers`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.apache.bcel.classfile.Node
`accept`

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(FieldOrMethod c)

  Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.

### FieldOrMethod

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

  Construct object from file stream.

Parameters:
  `file` - Input stream
Throws:
  `java.io.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

### dump

    public final void dump(java.io.DataOutputStream file)
                    throws java.io.IOException

  Dump object to file stream on binary format.

  Parameters:
    `file` - Output file stream
  Throws:
    `java.io.IOException`

### getAttributes

    public final Attribute[] getAttributes()

  Returns:
    Collection of object attributes.

### setAttributes

    public final void setAttributes(Attribute[] attributes)

  Parameters:
    `attributes` - Collection of object attributes.

### getConstantPool

    public final ConstantPool getConstantPool()

  Returns:
    Constant pool used by this object.

### setConstantPool

    public final void setConstantPool(ConstantPool constant_pool)

  Parameters:
    `constant_pool` - Constant pool to be used for this object.

### getNameIndex

    public final int getNameIndex()

  Returns:
    Index in constant pool of object's name.

### setNameIndex

    public final void setNameIndex(int name_index)

  Parameters:
    `name_index` - Index in constant pool of object's name.

### getSignatureIndex

    public final int getSignatureIndex()

  Returns:
    Index in constant pool of field signature.

### setSignatureIndex

    public final void setSignatureIndex(int signature_index)

  Parameters:
    `signature_index` - Index in constant pool of field signature.

### getName

    public final java.lang.String getName()

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

### getSignature

    public final java.lang.String getSignature()

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

### copy_

    protected FieldOrMethod copy_(ConstantPool constant_pool)

  Returns:
    deep copy of this field

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2003 Apache Software Foundation. All Rights Reserved.