Class ClassFile.MethodInfo

  • Enclosing class:
    ClassFile

    public class ClassFile.MethodInfo
    extends java.lang.Object
    Representation of a "method_info" structure, as defined by JVMS7 4.6.
    • Field Detail

      • nameIndex

        private final short nameIndex
      • descriptorIndex

        private final short descriptorIndex
    • Constructor Detail

      • MethodInfo

        public MethodInfo​(Java.Modifiers modifiers,
                          short nameIndex,
                          short descriptorIndex,
                          java.util.List<ClassFile.AttributeInfo> attributes)
        Initializes the "method_info" structure.
    • Method Detail

      • getModifierFlags

        public short getModifierFlags()
        Returns:
        The modifier flags of this method; or'ed values are the constants declared in Mod.
      • getAnnotations

        public Java.Annotation[] getAnnotations()
        Returns:
        The annotations of this method
      • getName

        public java.lang.String getName()
        Returns:
        The method's name
      • getDescriptor

        public java.lang.String getDescriptor()
        Returns:
        The method descriptor describing this method
      • addAttribute

        public void addAttribute​(ClassFile.AttributeInfo attribute)
        Adds the given attribute to this method.
      • store

        public void store​(java.io.DataOutputStream dos)
                   throws java.io.IOException
        Writes this object to a DataOutputStream, in the format described inJVMS7 4.6.
        Throws:
        java.io.IOException