Class ClassFile.CpInfo

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private ClassFile.ClassContext classContext
      The context to use to get the referenced constant pool items.
      private java.lang.String dump
      The dump of this item.
    • Constructor Summary

      Constructors 
      Constructor Description
      CpInfo​(java.lang.String dump)
      Constructs a CpInfo for an item without references to other items.
      CpInfo​(ClassFile.ClassContext classContext)
      Constructs a CpInfo for an item with references to other items.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.lang.String dump()
      Returns the dump of this item.
      (package private) <C extends ClassFile.CpInfo>
      C
      getCpInfo​(int cpIndex, java.lang.Class<C> cpInfoType)
      Returns the constant pool item with the given index.
      (package private) int size()
      Returns the number of entries used by this item in constant_pool.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • dump

        private java.lang.String dump
        The dump of this item.
      • classContext

        private final ClassFile.ClassContext classContext
        The context to use to get the referenced constant pool items.
    • Constructor Detail

      • CpInfo

        CpInfo​(java.lang.String dump)
        Constructs a CpInfo for an item without references to other items.
        Parameters:
        dump - the dump of this item.
      • CpInfo

        CpInfo​(ClassFile.ClassContext classContext)
        Constructs a CpInfo for an item with references to other items.
        Parameters:
        classContext - a context to lookup constant pool items from their index.
    • Method Detail

      • size

        int size()
        Returns the number of entries used by this item in constant_pool.
        Returns:
        the number of entries used by this item in constant_pool.
      • getCpInfo

        <C extends ClassFile.CpInfo> C getCpInfo​(int cpIndex,
                                                 java.lang.Class<C> cpInfoType)
        Returns the constant pool item with the given index.
        Type Parameters:
        C - a CpInfo subclass.
        Parameters:
        cpIndex - a constant pool entry index.
        cpInfoType - the expected type of the constant pool entry.
        Returns:
        the constant pool item with the given index.
      • dump

        java.lang.String dump()
        Returns the dump of this item.
        Returns:
        the dump of this item.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object