aQute.lib.osgi
Class Clazz

java.lang.Object
  extended by aQute.lib.osgi.Clazz

public class Clazz
extends java.lang.Object


Nested Class Summary
protected static class Clazz.Assoc
           
 
Constructor Summary
Clazz(java.lang.String path)
           
Clazz(java.lang.String path, java.io.InputStream in)
           
 
Method Summary
protected  void constantClass(java.io.DataInputStream in, int poolIndex)
           
protected  void constantDouble(java.io.DataInputStream in, int poolIndex)
           
protected  void constantLong(java.io.DataInputStream in, int poolIndex)
           
protected  void constantUtf8(java.io.DataInputStream in, int poolIndex)
           
protected  void crawl(byte[] code)
          We must find Class.forName references ...
static java.lang.String getPackage(java.lang.String clazz)
           
 java.lang.String getPath()
           
 java.util.Map getReferred()
           
 java.lang.String getSourceFile()
           
protected  void nameAndType(java.io.DataInputStream in, int poolIndex, byte tag)
           
protected  void pool(java.lang.Object[] pool, int[] intPool)
           
 void reset()
          .class construct for different compilers sun 1.1 Detect static variable class$com$acme$MyClass 1.2 " 1.3 " 1.4 " 1.5 ldc_w (class) 1.6 " eclipse 1.1 class$0, ldc (string), invokestatic Class.forName 1.2 " 1.3 " 1.5 ldc (class) 1.6 " 1.5 and later is not an issue, sun pre 1.5 is easy to detect the static variable that decodes the class name.
 java.util.Set xref(java.io.InputStream in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Clazz

public Clazz(java.lang.String path)

Clazz

public Clazz(java.lang.String path,
             java.io.InputStream in)
      throws java.io.IOException
Throws:
java.io.IOException
Method Detail

pool

protected void pool(java.lang.Object[] pool,
                    int[] intPool)

nameAndType

protected void nameAndType(java.io.DataInputStream in,
                           int poolIndex,
                           byte tag)
                    throws java.io.IOException
Parameters:
in -
poolIndex -
tag -
Throws:
java.io.IOException

constantClass

protected void constantClass(java.io.DataInputStream in,
                             int poolIndex)
                      throws java.io.IOException
Parameters:
in -
poolIndex -
Throws:
java.io.IOException

constantDouble

protected void constantDouble(java.io.DataInputStream in,
                              int poolIndex)
                       throws java.io.IOException
Parameters:
in -
Throws:
java.io.IOException

constantLong

protected void constantLong(java.io.DataInputStream in,
                            int poolIndex)
                     throws java.io.IOException
Parameters:
in -
Throws:
java.io.IOException

constantUtf8

protected void constantUtf8(java.io.DataInputStream in,
                            int poolIndex)
                     throws java.io.IOException
Parameters:
in -
poolIndex -
Throws:
java.io.IOException

crawl

protected void crawl(byte[] code)
We must find Class.forName references ...

Parameters:
code -

getPackage

public static java.lang.String getPackage(java.lang.String clazz)

getReferred

public java.util.Map getReferred()

getPath

public java.lang.String getPath()

xref

public java.util.Set xref(java.io.InputStream in)
                   throws java.io.IOException
Throws:
java.io.IOException

getSourceFile

public java.lang.String getSourceFile()

reset

public void reset()
.class construct for different compilers sun 1.1 Detect static variable class$com$acme$MyClass 1.2 " 1.3 " 1.4 " 1.5 ldc_w (class) 1.6 " eclipse 1.1 class$0, ldc (string), invokestatic Class.forName 1.2 " 1.3 " 1.5 ldc (class) 1.6 " 1.5 and later is not an issue, sun pre 1.5 is easy to detect the static variable that decodes the class name. For eclipse, the class$0 gives away we have a reference encoded in a string. compilerversions/compilerversions.jar contains test versions of all versions/compilers.