Top Description Fields Constructors Methods
javassist.bytecode

public Class EnclosingMethodAttribute

extends AttributeInfo
Class Inheritance
Imports
java.io.DataInputStream, .IOException, java.util.Map

EnclosingMethod_attribute.

Field Summary

Modifier and TypeField and Description
public static final String
tag

The name of this attribute "EnclosingMethod".

Inherited from javassist.bytecode.AttributeInfo:
constPoolinfoname

Constructor Summary

AccessConstructor and Description
pack-priv
public
EnclosingMethodAttribute(ConstPool
a constant pool table.
cp
,
String
the name of the innermost enclosing class.
className
,
String
the name of the enclosing method.
methodName
,
String
the descriptor of the enclosing method.
methodDesc
)

Constructs an EnclosingMethod attribute.

public
EnclosingMethodAttribute(ConstPool
a constant pool table.
cp
,
String
the name of the innermost enclosing class.
className
)

Constructs an EnclosingMethod attribute.

Method Summary

Modifier and TypeMethod and Description
public int
classIndex()

Returns the value of class_index.

public String
className()

Returns the name of the class specified by class_index.

public AttributeInfo
copy(ConstPool
the constant pool table used by the new copy.
newCp
,
Map<String, String>
pairs of replaced and substituted class names.
classnames
)

Overrides javassist.bytecode.AttributeInfo.copy.

Makes a copy.

public String
methodDescriptor()

Returns the method descriptor specified by method_index.

public int
methodIndex()

Returns the value of method_index.

public String
methodName()

Returns the method name specified by method_index.

Inherited from javassist.bytecode.AttributeInfo:
copyAllgetgetConstPoolgetLengthgetNamegetRefClassesgetRefClasseslengthlookupreadremoverenameClassrenameClassrenameClassrenameClasssetwritewriteAll

Field Detail

tagback to summary
public static final String tag

The name of this attribute "EnclosingMethod".

Constructor Detail

EnclosingMethodAttributeback to summary
pack-priv EnclosingMethodAttribute(ConstPool cp, int n, DataInputStream in) throws IOException
EnclosingMethodAttributeback to summary
public EnclosingMethodAttribute(ConstPool cp, String className, String methodName, String methodDesc)

Constructs an EnclosingMethod attribute.

Parameters
cp:ConstPool

a constant pool table.

className:String

the name of the innermost enclosing class.

methodName:String

the name of the enclosing method.

methodDesc:String

the descriptor of the enclosing method.

EnclosingMethodAttributeback to summary
public EnclosingMethodAttribute(ConstPool cp, String className)

Constructs an EnclosingMethod attribute. The value of method_index is set to 0.

Parameters
cp:ConstPool

a constant pool table.

className:String

the name of the innermost enclosing class.

Method Detail

classIndexback to summary
public int classIndex()

Returns the value of class_index.

classNameback to summary
public String className()

Returns the name of the class specified by class_index.

copyback to summary
public AttributeInfo copy(ConstPool newCp, Map<String, String> classnames)

Overrides javassist.bytecode.AttributeInfo.copy.

Makes a copy. Class names are replaced according to the given Map object.

Parameters
newCp:ConstPool

the constant pool table used by the new copy.

classnames:Map<String, String>

pairs of replaced and substituted class names.

Annotations
@Override
methodDescriptorback to summary
public String methodDescriptor()

Returns the method descriptor specified by method_index.

methodIndexback to summary
public int methodIndex()

Returns the value of method_index.

methodNameback to summary
public String methodName()

Returns the method name specified by method_index. If the method is a class initializer (static constructor), MethodInfo#nameClinit is returned.