Class CpInfo

    • Field Detail

      • refCount

        protected int refCount
        The Ref count.
    • Constructor Detail

      • CpInfo

        protected CpInfo​(int tag)
        Instantiates a new Cp info.
        Parameters:
        tag - the tag
    • Method Detail

      • create

        public static CpInfo create​(java.io.DataInput din)
                             throws java.io.IOException
        Create a new CpInfo from the data passed.
        Parameters:
        din - the din
        Returns:
        the cp info
        Throws:
        java.io.IOException - if class file is corrupt or incomplete
      • readInfo

        protected abstract void readInfo​(java.io.DataInput din)
                                  throws java.io.IOException
        Read the 'info' data following the u1tag byte; over-ride this in sub-classes.
        Parameters:
        din - the din
        Throws:
        java.io.IOException - the io exception
      • markUtf8Refs

        protected void markUtf8Refs​(ConstantPool pool)
        Check for Utf8 references to constant pool and mark them; over-ride this in sub-classes.
        Parameters:
        pool - the pool
      • markNTRefs

        protected void markNTRefs​(ConstantPool pool)
        Check for NameAndType references to constant pool and mark them; over-ride this in sub-classes.
        Parameters:
        pool - the pool
      • write

        public void write​(java.io.DataOutput dout)
                   throws java.io.IOException
        Export the representation to a DataOutput stream.
        Parameters:
        dout - the dout
        Throws:
        java.io.IOException - the io exception
      • writeInfo

        protected abstract void writeInfo​(java.io.DataOutput dout)
                                   throws java.io.IOException
        Write the 'info' data following the u1tag byte; over-ride this in sub-classes.
        Parameters:
        dout - the dout
        Throws:
        java.io.IOException - the io exception
      • getRefCount

        public int getRefCount()
        Return the reference count.
        Returns:
        the ref count
      • incRefCount

        public void incRefCount()
        Increment the reference count.
      • decRefCount

        public void decRefCount()
        Decrement the reference count.
      • resetRefCount

        public void resetRefCount()
        Reset the reference count to zero.
      • dump

        public void dump​(java.io.PrintWriter pw,
                         ClassFile cf,
                         int index)
        Dump the content of the class file to the specified file (used for debugging).
        Parameters:
        pw - the pw
        cf - the cf
        index - the index