Class EnclosingMethodAttribute


  • public class EnclosingMethodAttribute
    extends AttributeInfo
    EnclosingMethod_attribute.
    • Field Detail

      • tag

        public static final java.lang.String tag
        The name of this attribute "EnclosingMethod".
        See Also:
        Constant Field Values
    • Constructor Detail

      • EnclosingMethodAttribute

        EnclosingMethodAttribute​(ConstPool cp,
                                 int n,
                                 java.io.DataInputStream in)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • 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 of method_index is 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 of class_index.
      • methodIndex

        public int methodIndex()
        Returns the value of method_index.
      • className

        public java.lang.String className()
        Returns the name of the class specified by class_index.
      • methodName

        public java.lang.String methodName()
        Returns the method name specified by method_index. If the method is a class initializer (static constructor), MethodInfo.nameClinit is returned.
      • methodDescriptor

        public java.lang.String methodDescriptor()
        Returns the method descriptor specified by method_index.
      • copy

        public AttributeInfo copy​(ConstPool newCp,
                                  java.util.Map classnames)
        Makes a copy. Class names are replaced according to the given Map object.
        Overrides:
        copy in class AttributeInfo
        Parameters:
        newCp - the constant pool table used by the new copy.
        classnames - pairs of replaced and substituted class names.