APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.bcel.internal.generic

public abstract Class FieldGenOrMethodGen

extends AccessFlags
implements NamedAndTyped, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, com.sun.org.apache.bcel.internal.generic.NamedAndTyped
Known Direct Subclasses
com.sun.org.apache.bcel.internal.generic.MethodGen, com.sun.org.apache.bcel.internal.generic.FieldGen
Imports
java.util.ArrayList, .Collections, .List, com.sun.org.apache.bcel.internal.Const, com.sun.org.apache.bcel.internal.classfile.AccessFlags, .Attribute

Super class for FieldGen and MethodGen objects, since they have some methods in common!

Field Summary

Modifier and TypeField and Description
private final List<AnnotationEntryGen>
private final List<Attribute>
protected ConstantPoolGen
cp

Deprecated (since 6.0) will be made private; do not access directly, use getter/setter
protected String
name

Deprecated (since 6.0) will be made private; do not access directly, use getter/setter
protected Type
type

Deprecated (since 6.0) will be made private; do not access directly, use getter/setter
Inherited from com.sun.org.apache.bcel.internal.classfile.AccessFlags:
access_flags

Constructor Summary

AccessConstructor and Description
protected
protected
FieldGenOrMethodGen(final int accessFlags)

Method Summary

Modifier and TypeMethod and Description
protected void
addAll(final Attribute[] attributes)

public void
public void
addAttribute(final Attribute
attribute to be added
a
)

Add an attribute to this method.

public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public AnnotationEntryGen[]
public Attribute[]
getAttributes()

Returns: all attributes of this method.

public ConstantPoolGen
public String
getName()

Implements com.sun.org.apache.bcel.internal.generic.NamedAndTyped.getName.

Returns: name of method/field.

public abstract String
getSignature()

Returns: signature of method/field.

public Type
public void
public void
public void
removeAttribute(final Attribute a)

Remove an attribute.

public void
removeAttributes()

Remove all attributes.

public void
public void
public void
Inherited from com.sun.org.apache.bcel.internal.classfile.AccessFlags:
getAccessFlagsgetModifiersisAbstractisAbstractisAnnotationisAnnotationisEnumisEnumisFinalisFinalisInterfaceisInterfaceisNativeisNativeisPrivateisPrivateisProtectedisProtectedisPublicisPublicisStaticisStaticisStrictfpisStrictfpisSynchronizedisSynchronizedisSyntheticisSyntheticisTransientisTransientisVarArgsisVarArgsisVolatileisVolatilesetAccessFlagssetModifiers

Field Detail

annotationListback to summary
private final List<AnnotationEntryGen> annotationList
attributeListback to summary
private final List<Attribute> attributeList
cpback to summary
protected ConstantPoolGen cp

Deprecated

(since 6.0) will be made private; do not access directly, use getter/setter

Annotations
@Deprecated
nameback to summary
protected String name

Deprecated

(since 6.0) will be made private; do not access directly, use getter/setter

Annotations
@Deprecated
typeback to summary
protected Type type

Deprecated

(since 6.0) will be made private; do not access directly, use getter/setter

Annotations
@Deprecated

Constructor Detail

FieldGenOrMethodGenback to summary
protected FieldGenOrMethodGen()
FieldGenOrMethodGenback to summary
protected FieldGenOrMethodGen(final int accessFlags)
Since
6.0

Method Detail

addAllback to summary
protected void addAll(final Attribute[] attributes)
addAnnotationEntryback to summary
public void addAnnotationEntry(final AnnotationEntryGen ag)
Since
6.0
addAttributeback to summary
public void addAttribute(final Attribute a)

Add an attribute to this method. Currently, the JVM knows about the 'Code', 'ConstantValue', 'Synthetic' and 'Exceptions' attributes. Other attributes will be ignored by the JVM but do no harm.

Parameters
a:Attribute

attribute to be added

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Annotations
@Override
getAnnotationEntriesback to summary
public AnnotationEntryGen[] getAnnotationEntries()
getAttributesback to summary
public Attribute[] getAttributes()
Returns:Attribute[]

all attributes of this method.

getConstantPoolback to summary
public ConstantPoolGen getConstantPool()
getNameback to summary
public String getName()

Implements com.sun.org.apache.bcel.internal.generic.NamedAndTyped.getName.

Returns:String

name of method/field.

Annotations
@Override
getSignatureback to summary
public abstract String getSignature()
Returns:String

signature of method/field.

getTypeback to summary
public Type getType()

Implements com.sun.org.apache.bcel.internal.generic.NamedAndTyped.getType.

Annotations
@Override
removeAnnotationEntriesback to summary
public void removeAnnotationEntries()
Since
6.0
removeAnnotationEntryback to summary
public void removeAnnotationEntry(final AnnotationEntryGen ag)
Since
6.0
removeAttributeback to summary
public void removeAttribute(final Attribute a)

Remove an attribute.

removeAttributesback to summary
public void removeAttributes()

Remove all attributes.

setConstantPoolback to summary
public void setConstantPool(final ConstantPoolGen cp)
setNameback to summary
public void setName(final String name)

Implements com.sun.org.apache.bcel.internal.generic.NamedAndTyped.setName.

Annotations
@Override
setTypeback to summary
public void setType(final Type type)

Implements com.sun.org.apache.bcel.internal.generic.NamedAndTyped.setType.

Annotations
@Override