Package javassist.bytecode
Class EnclosingMethodAttribute
- java.lang.Object
-
- javassist.bytecode.AttributeInfo
-
- javassist.bytecode.EnclosingMethodAttribute
-
public class EnclosingMethodAttribute extends AttributeInfo
EnclosingMethod_attribute.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringtagThe name of this attribute"EnclosingMethod".
-
Constructor Summary
Constructors Constructor Description EnclosingMethodAttribute(ConstPool cp, java.lang.String className)Constructs an EnclosingMethod attribute.EnclosingMethodAttribute(ConstPool cp, java.lang.String className, java.lang.String methodName, java.lang.String methodDesc)Constructs an EnclosingMethod attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intclassIndex()Returns the value ofclass_index.java.lang.StringclassName()Returns the name of the class specified byclass_index.AttributeInfocopy(ConstPool newCp, java.util.Map<java.lang.String,java.lang.String> classnames)Makes a copy.java.lang.StringmethodDescriptor()Returns the method descriptor specified bymethod_index.intmethodIndex()Returns the value ofmethod_index.java.lang.StringmethodName()Returns the method name specified bymethod_index.-
Methods inherited from class javassist.bytecode.AttributeInfo
get, getConstPool, getName, length, set
-
-
-
-
Field Detail
-
tag
public static final java.lang.String tag
The name of this attribute"EnclosingMethod".- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EnclosingMethodAttribute
public EnclosingMethodAttribute(ConstPool cp, java.lang.String className, java.lang.String methodName, java.lang.String methodDesc)
Constructs an EnclosingMethod attribute.- Parameters:
cp- a constant pool table.className- the name of the innermost enclosing class.methodName- the name of the enclosing method.methodDesc- the descriptor of the enclosing method.
-
EnclosingMethodAttribute
public EnclosingMethodAttribute(ConstPool cp, java.lang.String className)
Constructs an EnclosingMethod attribute. The value ofmethod_indexis set to 0.- Parameters:
cp- a constant pool table.className- the name of the innermost enclosing class.
-
-
Method Detail
-
classIndex
public int classIndex()
Returns the value ofclass_index.
-
methodIndex
public int methodIndex()
Returns the value ofmethod_index.
-
className
public java.lang.String className()
Returns the name of the class specified byclass_index.
-
methodName
public java.lang.String methodName()
Returns the method name specified bymethod_index. If the method is a class initializer (static constructor),MethodInfo.nameClinitis returned.
-
methodDescriptor
public java.lang.String methodDescriptor()
Returns the method descriptor specified bymethod_index.
-
copy
public AttributeInfo copy(ConstPool newCp, java.util.Map<java.lang.String,java.lang.String> classnames)
Makes a copy. Class names are replaced according to the givenMapobject.- Overrides:
copyin classAttributeInfo- Parameters:
newCp- the constant pool table used by the new copy.classnames- pairs of replaced and substituted class names.
-
-