Class BinaryConstantPool

java.lang.Object
org.glassfish.rmic.tools.binaryclass.BinaryConstantPool
All Implemented Interfaces:
Constants, RuntimeConstants

public final class BinaryConstantPool extends Object implements Constants
This class is used to represent a constant table once it is read from a class file. WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.
  • Field Details

  • Constructor Details

  • Method Details

    • readBytes

      private byte[] readBytes(DataInputStream in, int cnt) throws IOException
      Throws:
      IOException
    • getInteger

      public int getInteger(int n)
      get a integer
    • getValue

      public Object getValue(int n)
      get a value
    • getString

      public String getString(int n)
      get a string
    • getIdentifier

      public Identifier getIdentifier(int n)
      get an identifier
    • getDeclarationFromName

      public ClassDeclaration getDeclarationFromName(Environment env, int n)
      get class declaration
    • getDeclaration

      public ClassDeclaration getDeclaration(Environment env, int n)
      get class declaration
    • getType

      public Type getType(int n)
      get a type from a type signature
    • getConstantType

      public int getConstantType(int n)
      get the type of constant given an index
    • getConstant

      public Object getConstant(int n, Environment env)
      get the n-th constant from the constant pool
    • getDependencies

      public Vector<ClassDeclaration> getDependencies(Environment env)
      Get a list of dependencies, ie: all the classes referenced in this constant pool.
    • indexObject

      public int indexObject(Object obj, Environment env)
      Find the index of an Object in the constant pool
    • indexString

      public int indexString(String string, Environment env)
      Find the index of an ascii string in the constant pool. If it's not in the constant pool, then add it at the end.
    • createIndexHash

      public void createIndexHash(Environment env)
      Create a hash table of all the items in the constant pool that could possibly be referenced from the outside.
    • write

      public void write(DataOutputStream out, Environment env) throws IOException
      Write out the contents of the constant pool, including any additions that have been added.
      Throws:
      IOException