org.apache.batik.util

Class ClassFileUtilities

public class ClassFileUtilities extends Object

This class contains utility methods to manipulate Java classes.
Nested Class Summary
protected static classClassFileUtilities.ClassFile
protected static classClassFileUtilities.Jar
protected static classClassFileUtilities.Triple
Field Summary
static byteCONSTANT_CLASS_INFO
static byteCONSTANT_DOUBLE_INFO
static byteCONSTANT_FIELDREF_INFO
static byteCONSTANT_FLOAT_INFO
static byteCONSTANT_INTEGER_INFO
static byteCONSTANT_INTERFACEMETHODREF_INFO
static byteCONSTANT_LONG_INFO
static byteCONSTANT_METHODREF_INFO
static byteCONSTANT_NAMEANDTYPE_INFO
static byteCONSTANT_STRING_INFO
static byteCONSTANT_UTF8_INFO
Constructor Summary
protected ClassFileUtilities()
This class does not need to be instantiated.
Method Summary
static SetgetClassDependencies(String path, Set classpath, boolean rec)
Returns the dependencies of the given class.
static SetgetClassDependencies(InputStream is, Set classpath, boolean rec)
static SetgetClassDependencies(InputStream is)
Returns the dependencies of the given class.
protected static SetgetDescriptorClasses(String desc)
Returns the classes contained in a field or method desciptor.
static voidmain(String[] args)
Program that computes the dependencies between the Batik jars.

Field Detail

CONSTANT_CLASS_INFO

public static final byte CONSTANT_CLASS_INFO

CONSTANT_DOUBLE_INFO

public static final byte CONSTANT_DOUBLE_INFO

CONSTANT_FIELDREF_INFO

public static final byte CONSTANT_FIELDREF_INFO

CONSTANT_FLOAT_INFO

public static final byte CONSTANT_FLOAT_INFO

CONSTANT_INTEGER_INFO

public static final byte CONSTANT_INTEGER_INFO

CONSTANT_INTERFACEMETHODREF_INFO

public static final byte CONSTANT_INTERFACEMETHODREF_INFO

CONSTANT_LONG_INFO

public static final byte CONSTANT_LONG_INFO

CONSTANT_METHODREF_INFO

public static final byte CONSTANT_METHODREF_INFO

CONSTANT_NAMEANDTYPE_INFO

public static final byte CONSTANT_NAMEANDTYPE_INFO

CONSTANT_STRING_INFO

public static final byte CONSTANT_STRING_INFO

CONSTANT_UTF8_INFO

public static final byte CONSTANT_UTF8_INFO

Constructor Detail

ClassFileUtilities

protected ClassFileUtilities()
This class does not need to be instantiated.

Method Detail

getClassDependencies

public static Set getClassDependencies(String path, Set classpath, boolean rec)
Returns the dependencies of the given class.

Parameters: path The root class path. classpath The set of directories (Strings) to scan. rec Whether to follow dependencies recursively.

Returns: a list of paths representing the used classes.

getClassDependencies

public static Set getClassDependencies(InputStream is, Set classpath, boolean rec)

getClassDependencies

public static Set getClassDependencies(InputStream is)
Returns the dependencies of the given class.

Returns: a list of strings representing the used classes.

getDescriptorClasses

protected static Set getDescriptorClasses(String desc)
Returns the classes contained in a field or method desciptor.

main

public static void main(String[] args)
Program that computes the dependencies between the Batik jars.

Run this from the main Batik distribution directory, after building the jars. For every jar file in the batik-xxx/ build directory, it will determine which other jar files it directly depends on. The output is lines of the form:

  number,from,to

where mean that the from jar has number class files that depend on class files in the to jar.

Copyright B) 2008 Apache Software Foundation. All Rights Reserved.