Package serp.bytecode

Class Attribute

    • Field Detail

      • _nameIndex

        private int _nameIndex
    • Constructor Detail

      • Attribute

        Attribute​(int nameIndex,
                  Attributes owner)
    • Method Detail

      • create

        static Attribute create​(java.lang.String name,
                                Attributes owner)
        Create an attribute of the appropriate type based on the the attribute name.
      • getNameIndex

        public int getNameIndex()
        Return the index in the ConstantPool of the UTF8Entry holding the name of this attribute.
      • getName

        public java.lang.String getName()
        Return the name of this attribute.
      • getProject

        public Project getProject()
        Description copied from interface: BCEntity
        Return the project of the current class.
        Specified by:
        getProject in interface BCEntity
      • getPool

        public ConstantPool getPool()
        Description copied from interface: BCEntity
        Return the constant pool of the current class.
        Specified by:
        getPool in interface BCEntity
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Description copied from interface: BCEntity
        Return the class loader to use when loading related classes.
        Specified by:
        getClassLoader in interface BCEntity
      • isValid

        public boolean isValid()
        Description copied from interface: BCEntity
        Return false if this entity has been removed from its parent; in this case the results of any operations on the entity are undefined.
        Specified by:
        isValid in interface BCEntity
      • getAttributesHolder

        java.util.Collection getAttributesHolder()
        Description copied from class: Attributes
        Return the collection used to hold the attributes of this entity.
        Specified by:
        getAttributesHolder in class Attributes
      • invalidate

        void invalidate()
        Invalidate this attribute.
      • getLength

        int getLength()
        Return the length of the bytecode representation of this attribute in bytes, excluding the name index.
      • read

        void read​(Attribute other)
        Copy the information from the given attribute to this one. Does nothing by default.
      • read

        void read​(java.io.DataInput in,
                  int length)
           throws java.io.IOException
        Read the attribute bytecode from the given stream, up to length bytes, excluding the name index. Does nothing by default.
        Throws:
        java.io.IOException
      • write

        void write​(java.io.DataOutput out,
                   int length)
            throws java.io.IOException
        Write the attribute bytecode to the given stream, up to length bytes, excluding the name index. Does nothing by default.
        Throws:
        java.io.IOException