Class FieldOrMethod

java.lang.Object
org.aspectj.apache.bcel.classfile.Modifiers
org.aspectj.apache.bcel.classfile.FieldOrMethod
All Implemented Interfaces:
Node
Direct Known Subclasses:
Field, Method

public abstract class FieldOrMethod extends Modifiers implements Node
Abstract super class for fields and methods.
Version:
$Id: FieldOrMethod.java,v 1.12 2009/09/15 19:40:12 aclement Exp $
Author:
M. Dahm
  • Field Details

    • nameIndex

      protected int nameIndex
    • signatureIndex

      protected int signatureIndex
    • attributes

      protected Attribute[] attributes
    • cpool

      protected ConstantPool cpool
  • Constructor Details

    • FieldOrMethod

      protected FieldOrMethod()
    • 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(DataInputStream file, ConstantPool cpool) throws IOException
      Throws:
      IOException
    • FieldOrMethod

      protected FieldOrMethod(int accessFlags, int nameIndex, int signatureIndex, Attribute[] attributes, ConstantPool cpool)
  • Method Details

    • setAttributes

      public void setAttributes(Attribute[] attributes)
      Parameters:
      attributes - Collection of object attributes.
    • dump

      public final void dump(DataOutputStream file) throws IOException
      Throws:
      IOException
    • getAttributes

      public final Attribute[] getAttributes()
    • getConstantPool

      public final ConstantPool getConstantPool()
    • getNameIndex

      public final int getNameIndex()
    • getSignatureIndex

      public final int getSignatureIndex()
    • getName

      public final String getName()
    • getSignature

      public final String getSignature()
    • getDeclaredSignature

      public final String getDeclaredSignature()
      This will return the contents of a signature attribute attached to a member, or if there is none it will return the same as 'getSignature()'. Signature attributes are attached to members that were declared generic.
    • getAnnotations

      public AnnotationGen[] getAnnotations()
    • getGenericSignature

      public final String getGenericSignature()
      Hunts for a signature attribute on the member and returns its contents. So where the 'regular' signature may be (Ljava/util/Vector;)V the signature attribute may in fact say 'Ljava/lang/Vector;' Coded for performance - searches for the attribute only when requested - only searches for it once.