public class

Clazz

extends Object
java.lang.Object
   ↳ com.atlassian.plugin.osgi.util.Clazz

Class Overview

Copied from the bndlib version 0.255, adding the capture of referred classes

Summary

Nested Classes
class Clazz.Assoc  
Public Constructors
Clazz(String path)
Clazz(String path, InputStream in)
Public Methods
static String getPackage(String clazz)
String getPath()
Map getReferred()
Set getReferredClasses()
String getSourceFile()
String getSuperClassName()
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.
Set xref(InputStream in)
Protected Methods
void constantClass(DataInputStream in, int poolIndex)
void constantDouble(DataInputStream in, int poolIndex)
void constantLong(DataInputStream in, int poolIndex)
void constantUtf8(DataInputStream in, int poolIndex)
void crawl(byte[] code)
We must find Class.forName references ...
void nameAndType(DataInputStream in, int poolIndex, byte tag)
void pool(Object[] pool, int[] intPool)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Clazz (String path)

public Clazz (String path, InputStream in)

Throws
IOException

Public Methods

public static String getPackage (String clazz)

public String getPath ()

public Map getReferred ()

public Set getReferredClasses ()

public String getSourceFile ()

public String getSuperClassName ()

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.

public Set xref (InputStream in)

Throws
IOException

Protected Methods

protected void constantClass (DataInputStream in, int poolIndex)

Throws
IOException

protected void constantDouble (DataInputStream in, int poolIndex)

Throws
IOException

protected void constantLong (DataInputStream in, int poolIndex)

Throws
IOException

protected void constantUtf8 (DataInputStream in, int poolIndex)

Throws
IOException

protected void crawl (byte[] code)

We must find Class.forName references ...

protected void nameAndType (DataInputStream in, int poolIndex, byte tag)

Throws
IOException

protected void pool (Object[] pool, int[] intPool)