Package org.apache.batik.util
Class ClassFileUtilities
java.lang.Object
org.apache.batik.util.ClassFileUtilities
This class contains utility methods to manipulate Java classes.
- Version:
- $Id: ClassFileUtilities.java 1804130 2017-08-04 14:41:11Z ssteiner $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
protected static class
protected static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
This class does not need to be instantiated. -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
collectJars
(File dir, Map jars, Map classFiles) private static void
computeClassDependencies
(InputStream is, Set classpath, Set done, Set result, boolean rec) static Set
Returns the dependencies of the given class.static Set
getClassDependencies
(InputStream is, Set classpath, boolean rec) static Set
getClassDependencies
(String path, Set classpath, boolean rec) Returns the dependencies of the given class.protected static Set
getDescriptorClasses
(String desc) Returns the classes contained in a field or method desciptor.static void
Program that computes the dependencies between the Batik jars.
-
Field Details
-
CONSTANT_UTF8_INFO
public static final byte CONSTANT_UTF8_INFO- See Also:
-
CONSTANT_INTEGER_INFO
public static final byte CONSTANT_INTEGER_INFO- See Also:
-
CONSTANT_FLOAT_INFO
public static final byte CONSTANT_FLOAT_INFO- See Also:
-
CONSTANT_LONG_INFO
public static final byte CONSTANT_LONG_INFO- See Also:
-
CONSTANT_DOUBLE_INFO
public static final byte CONSTANT_DOUBLE_INFO- See Also:
-
CONSTANT_CLASS_INFO
public static final byte CONSTANT_CLASS_INFO- See Also:
-
CONSTANT_STRING_INFO
public static final byte CONSTANT_STRING_INFO- See Also:
-
CONSTANT_FIELDREF_INFO
public static final byte CONSTANT_FIELDREF_INFO- See Also:
-
CONSTANT_METHODREF_INFO
public static final byte CONSTANT_METHODREF_INFO- See Also:
-
CONSTANT_INTERFACEMETHODREF_INFO
public static final byte CONSTANT_INTERFACEMETHODREF_INFO- See Also:
-
CONSTANT_NAMEANDTYPE_INFO
public static final byte CONSTANT_NAMEANDTYPE_INFO- See Also:
-
-
Constructor Details
-
ClassFileUtilities
protected ClassFileUtilities()This class does not need to be instantiated.
-
-
Method Details
-
main
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.
-
collectJars
- Throws:
IOException
-
getClassDependencies
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.
- Throws:
IOException
-
getClassDependencies
public static Set getClassDependencies(InputStream is, Set classpath, boolean rec) throws IOException - Throws:
IOException
-
computeClassDependencies
private static void computeClassDependencies(InputStream is, Set classpath, Set done, Set result, boolean rec) throws IOException - Throws:
IOException
-
getClassDependencies
Returns the dependencies of the given class.- Returns:
- a list of strings representing the used classes.
- Throws:
IOException
-
getDescriptorClasses
Returns the classes contained in a field or method desciptor.
-