Package org.apache.batik.util
Class ClassFileUtilities
- java.lang.Object
-
- org.apache.batik.util.ClassFileUtilities
-
public class ClassFileUtilities extends java.lang.ObjectThis class contains utility methods to manipulate Java classes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classClassFileUtilities.ClassFileprotected static classClassFileUtilities.Jarprotected static classClassFileUtilities.Triple
-
Field Summary
Fields Modifier and Type Field Description static byteCONSTANT_CLASS_INFOstatic byteCONSTANT_DOUBLE_INFOstatic byteCONSTANT_FIELDREF_INFOstatic byteCONSTANT_FLOAT_INFOstatic byteCONSTANT_INTEGER_INFOstatic byteCONSTANT_INTERFACEMETHODREF_INFOstatic byteCONSTANT_LONG_INFOstatic byteCONSTANT_METHODREF_INFOstatic byteCONSTANT_NAMEANDTYPE_INFOstatic byteCONSTANT_STRING_INFOstatic byteCONSTANT_UTF8_INFO
-
Constructor Summary
Constructors Modifier Constructor Description protectedClassFileUtilities()This class does not need to be instantiated.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.SetgetClassDependencies(java.io.InputStream is)Returns the dependencies of the given class.static java.util.SetgetClassDependencies(java.io.InputStream is, java.util.Set classpath, boolean rec)static java.util.SetgetClassDependencies(java.lang.String path, java.util.Set classpath, boolean rec)Returns the dependencies of the given class.protected static java.util.SetgetDescriptorClasses(java.lang.String desc)Returns the classes contained in a field or method desciptor.static voidmain(java.lang.String[] args)Program that computes the dependencies between the Batik jars.
-
-
-
Field Detail
-
CONSTANT_UTF8_INFO
public static final byte CONSTANT_UTF8_INFO
- See Also:
- Constant Field Values
-
CONSTANT_INTEGER_INFO
public static final byte CONSTANT_INTEGER_INFO
- See Also:
- Constant Field Values
-
CONSTANT_FLOAT_INFO
public static final byte CONSTANT_FLOAT_INFO
- See Also:
- Constant Field Values
-
CONSTANT_LONG_INFO
public static final byte CONSTANT_LONG_INFO
- See Also:
- Constant Field Values
-
CONSTANT_DOUBLE_INFO
public static final byte CONSTANT_DOUBLE_INFO
- See Also:
- Constant Field Values
-
CONSTANT_CLASS_INFO
public static final byte CONSTANT_CLASS_INFO
- See Also:
- Constant Field Values
-
CONSTANT_STRING_INFO
public static final byte CONSTANT_STRING_INFO
- See Also:
- Constant Field Values
-
CONSTANT_FIELDREF_INFO
public static final byte CONSTANT_FIELDREF_INFO
- See Also:
- Constant Field Values
-
CONSTANT_METHODREF_INFO
public static final byte CONSTANT_METHODREF_INFO
- See Also:
- Constant Field Values
-
CONSTANT_INTERFACEMETHODREF_INFO
public static final byte CONSTANT_INTERFACEMETHODREF_INFO
- See Also:
- Constant Field Values
-
CONSTANT_NAMEANDTYPE_INFO
public static final byte CONSTANT_NAMEANDTYPE_INFO
- See Also:
- Constant Field Values
-
-
Method Detail
-
main
public static void main(java.lang.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.
-
getClassDependencies
public static java.util.Set getClassDependencies(java.lang.String path, java.util.Set classpath, boolean rec) throws java.io.IOExceptionReturns 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.
- Throws:
java.io.IOException
-
getClassDependencies
public static java.util.Set getClassDependencies(java.io.InputStream is, java.util.Set classpath, boolean rec) throws java.io.IOException- Throws:
java.io.IOException
-
getClassDependencies
public static java.util.Set getClassDependencies(java.io.InputStream is) throws java.io.IOExceptionReturns the dependencies of the given class.- Returns:
- a list of strings representing the used classes.
- Throws:
java.io.IOException
-
getDescriptorClasses
protected static java.util.Set getDescriptorClasses(java.lang.String desc)
Returns the classes contained in a field or method desciptor.
-
-