Package org.apache.bcel.classfile
Class FieldOrMethod
java.lang.Object
org.apache.bcel.classfile.AccessFlags
org.apache.bcel.classfile.FieldOrMethod
- All Implemented Interfaces:
Serializable
,Cloneable
,Node
Abstract super class for fields and methods.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AnnotationEntry[]
protected Attribute[]
protected int
protected ConstantPool
protected int
protected int
Fields inherited from class org.apache.bcel.classfile.AccessFlags
access_flags
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FieldOrMethod
(int access_flags, int name_index, int signature_index, Attribute[] attributes, ConstantPool constant_pool) protected
FieldOrMethod
(DataInputStream file, ConstantPool constant_pool) Construct object from file stream.protected
Initialize from another object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected FieldOrMethod
copy_
(ConstantPool _constant_pool) final void
dump
(DataOutputStream file) Dump object to file stream on binary format.final Attribute[]
final ConstantPool
final String
Hunts for a signature attribute on the member and returns its contents.final String
getName()
final int
final String
final int
final void
setAttributes
(Attribute[] attributes) final void
setConstantPool
(ConstantPool constant_pool) final void
setNameIndex
(int name_index) final void
setSignatureIndex
(int signature_index) Methods inherited from class org.apache.bcel.classfile.AccessFlags
getAccessFlags, 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, isVolatile, isVolatile, setAccessFlags, setModifiers
-
Field Details
-
name_index
protected int name_index -
signature_index
protected int signature_index -
attributes_count
protected int attributes_count -
attributes
-
annotationEntries
-
constant_pool
-
-
Constructor Details
-
FieldOrMethod
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 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 methodname_index
- Points to field name in constant poolsignature_index
- Points to encoded signatureattributes
- Collection of attributesconstant_pool
- Array of constants
-
-
Method Details
-
dump
Dump object to file stream on binary format.- Parameters:
file
- Output file stream- Throws:
IOException
-
getAttributes
- Returns:
- Collection of object attributes.
-
setAttributes
- Parameters:
attributes
- Collection of object attributes.
-
getConstantPool
- Returns:
- Constant pool used by this object.
-
setConstantPool
- 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
- Returns:
- Name of object, i.e., method name or field name
-
getSignature
- Returns:
- String representation of object's type signature (java style)
-
copy_
- Returns:
- deep copy of this field
-
getAnnotationEntries
-
addAnnotationEntry
-
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/Vectorinvalid input: '<'Ljava/lang/String>;' Coded for performance - searches for the attribute only when requested - only searches for it once.
-