Package 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
 
 public abstract class FieldOrMethod extends AccessFlags implements java.lang.Cloneable, Node Abstract super class for fields and methods.
- 
- 
Field SummaryFields Modifier and Type Field Description protected Attribute[]attributesDeprecated.(since 6.0) will be made private; do not access directly, use getter/setterprotected intattributes_countDeprecated.(since 6.0) will be removed (not needed)protected ConstantPoolconstant_poolDeprecated.(since 6.0) will be made private; do not access directly, use getter/setterprotected intname_indexDeprecated.(since 6.0) will be made private; do not access directly, use getter/setterprotected intsignature_indexDeprecated.(since 6.0) will be made private; do not access directly, use getter/setter- 
Fields inherited from class org.apache.bcel.classfile.AccessFlagsaccess_flags
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedFieldOrMethod(int access_flags, int name_index, int signature_index, Attribute[] attributes, ConstantPool constant_pool)protectedFieldOrMethod(java.io.DataInput file, ConstantPool constant_pool)Construct object from file stream.protectedFieldOrMethod(java.io.DataInputStream file, ConstantPool constant_pool)Deprecated.(6.0) UseFieldOrMethod(java.io.DataInput, ConstantPool)instead.protectedFieldOrMethod(FieldOrMethod c)Initialize from another object.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FieldOrMethodcopy_(ConstantPool _constant_pool)voiddump(java.io.DataOutputStream file)Dump object to file stream on binary format.AnnotationEntry[]getAnnotationEntries()Attribute[]getAttributes()ConstantPoolgetConstantPool()java.lang.StringgetGenericSignature()Hunts for a signature attribute on the member and returns its contents.java.lang.StringgetName()intgetNameIndex()java.lang.StringgetSignature()intgetSignatureIndex()voidsetAttributes(Attribute[] attributes)voidsetConstantPool(ConstantPool constant_pool)voidsetNameIndex(int name_index)voidsetSignatureIndex(int signature_index)- 
Methods inherited from class org.apache.bcel.classfile.AccessFlagsgetAccessFlags, getModifiers, isAbstract, isAbstract, isAnnotation, isAnnotation, isEnum, isEnum, isFinal, isFinal, isInterface, isInterface, isNative, isNative, isPrivate, isPrivate, isProtected, isProtected, isPublic, isPublic, isStatic, isStatic, isStrictfp, isStrictfp, isSynchronized, isSynchronized, isSynthetic, isSynthetic, isTransient, isTransient, isVarArgs, isVarArgs, isVolatile, isVolatile, setAccessFlags, setModifiers
 
- 
 
- 
- 
- 
Field Detail- 
name_index@Deprecated protected int name_index Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter
 - 
signature_index@Deprecated protected int signature_index Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter
 - 
attributes@Deprecated protected Attribute[] attributes Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter
 - 
attributes_count@Deprecated protected int attributes_count Deprecated.(since 6.0) will be removed (not needed)
 - 
constant_pool@Deprecated protected ConstantPool constant_pool Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter
 
- 
 - 
Constructor Detail- 
FieldOrMethodprotected FieldOrMethod(FieldOrMethod c) Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.
 - 
FieldOrMethod@Deprecated protected FieldOrMethod(java.io.DataInputStream file, ConstantPool constant_pool) throws java.io.IOException, ClassFormatExceptionDeprecated.(6.0) UseFieldOrMethod(java.io.DataInput, ConstantPool)instead.Construct object from file stream.- Parameters:
- file- Input stream
- Throws:
- java.io.IOException
- ClassFormatException
 
 - 
FieldOrMethodprotected FieldOrMethod(java.io.DataInput file, ConstantPool constant_pool) throws java.io.IOException, ClassFormatExceptionConstruct object from file stream.- Parameters:
- file- Input stream
- Throws:
- java.io.IOException
- ClassFormatException
 
 - 
FieldOrMethodprotected 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- 
dumppublic final void dump(java.io.DataOutputStream file) throws java.io.IOExceptionDump object to file stream on binary format.- Parameters:
- file- Output file stream
- Throws:
- java.io.IOException
 
 - 
getAttributespublic final Attribute[] getAttributes() - Returns:
- Collection of object attributes.
 
 - 
setAttributespublic final void setAttributes(Attribute[] attributes) - Parameters:
- attributes- Collection of object attributes.
 
 - 
getConstantPoolpublic final ConstantPool getConstantPool() - Returns:
- Constant pool used by this object.
 
 - 
setConstantPoolpublic final void setConstantPool(ConstantPool constant_pool) - Parameters:
- constant_pool- Constant pool to be used for this object.
 
 - 
getNameIndexpublic final int getNameIndex() - Returns:
- Index in constant pool of object's name.
 
 - 
setNameIndexpublic final void setNameIndex(int name_index) - Parameters:
- name_index- Index in constant pool of object's name.
 
 - 
getSignatureIndexpublic final int getSignatureIndex() - Returns:
- Index in constant pool of field signature.
 
 - 
setSignatureIndexpublic final void setSignatureIndex(int signature_index) - Parameters:
- signature_index- Index in constant pool of field signature.
 
 - 
getNamepublic final java.lang.String getName() - Returns:
- Name of object, i.e., method name or field name
 
 - 
getSignaturepublic 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
 
 - 
getAnnotationEntriespublic AnnotationEntry[] getAnnotationEntries() - Returns:
- Annotations on the field or method
- Since:
- 6.0
 
 - 
getGenericSignaturepublic final java.lang.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<Ljava/lang/String>;' Coded for performance - searches for the attribute only when requested - only searches for it once.- Since:
- 6.0
 
 
- 
 
-