Class MemberInfo

  • Direct Known Subclasses:
    FieldInfo, MethodInfo

    public abstract class MemberInfo
    extends java.lang.Object
    Base class for information about members (fields and methods).
    Version:
    1.0
    See Also:
    FieldInfo, MethodInfo
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int accessFlags
      A mask of flags used to denote access permission to and properties of this method.
      protected ClassFile cf
      The class file in which this method is defined.
      private boolean deprecated
      Whether this member is deprecated.
      static java.lang.String DEPRECATED
      Attribute marking a member as deprecated.
      static java.lang.String RUNTIME_VISIBLE_ANNOTATIONS
      Attribute containing runtime-visible annotations.
      static java.lang.String SIGNATURE
      Attribute containing index of the member's signature.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected MemberInfo​(ClassFile cf, int accessFlags)
      Constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int getAccessFlags()
      Returns the access flags for this field.
      ClassFile getClassFile()
      Returns the parent class file.
      abstract java.lang.String getDescriptor()
      Returns the descriptor of this member.
      abstract java.lang.String getName()
      Returns the name of this member.
      boolean isDeprecated()
      Returns whether this member is deprecated.
      boolean isFinal()
      Returns whether this member is final.
      boolean isStatic()
      Returns whether this member is static.
      protected AttributeInfo readAttribute​(java.io.DataInputStream in, java.lang.String attrName, int attrLength)
      Reads attributes common to all members.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • cf

        protected ClassFile cf
        The class file in which this method is defined.
      • accessFlags

        private int accessFlags
        A mask of flags used to denote access permission to and properties of this method.
      • deprecated

        private boolean deprecated
        Whether this member is deprecated.
      • DEPRECATED

        public static final java.lang.String DEPRECATED
        Attribute marking a member as deprecated.
        See Also:
        Constant Field Values
      • SIGNATURE

        public static final java.lang.String SIGNATURE
        Attribute containing index of the member's signature.
        See Also:
        Constant Field Values
      • RUNTIME_VISIBLE_ANNOTATIONS

        public static final java.lang.String RUNTIME_VISIBLE_ANNOTATIONS
        Attribute containing runtime-visible annotations.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MemberInfo

        protected MemberInfo​(ClassFile cf,
                             int accessFlags)
        Constructor.
        Parameters:
        cf - The class file defining this member.
    • Method Detail

      • getAccessFlags

        public int getAccessFlags()
        Returns the access flags for this field.
        Returns:
        The access flags, as a bit field.
        See Also:
        AccessFlags
      • getClassFile

        public ClassFile getClassFile()
        Returns the parent class file.
        Returns:
        The parent class file.
      • getName

        public abstract java.lang.String getName()
        Returns the name of this member.
        Returns:
        The name of this member.
      • isDeprecated

        public boolean isDeprecated()
        Returns whether this member is deprecated.
        Returns:
        Whether this member is deprecated.
      • getDescriptor

        public abstract java.lang.String getDescriptor()
        Returns the descriptor of this member.
        Returns:
        The descriptor of this member.
      • isFinal

        public boolean isFinal()
        Returns whether this member is final.
        Returns:
        Whether this member is final.
      • isStatic

        public boolean isStatic()
        Returns whether this member is static.
        Returns:
        Whether this member is static.
      • readAttribute

        protected AttributeInfo readAttribute​(java.io.DataInputStream in,
                                              java.lang.String attrName,
                                              int attrLength)
                                       throws java.io.IOException
        Reads attributes common to all members. If the specified attribute is not common to members, the attribute returned is an "unsupported" attribute.
        Parameters:
        in - The input stream to read from.
        attrName - The attribute name.
        attrLength - The attribute length.
        Returns:
        The attribute, or null if it was purposely skipped for some reason (known to be useless for our purposes, etc.).
        Throws:
        java.io.IOException - If an IO error occurs.