final ClassHierarchyProcessor finder = new ClassHierarchyProcessor(
urlClassLoader);
@SuppressWarnings("unused")
final Repository repository = new ClassLoaderRepository(
urlClassLoader);
final ClassRenderingStrategy strategy = DefaultClassRenderingStrategy.SHOW_ALL_DECLARED_METHODS;
CallGraphGeneratorUtils
.draw(
new GraphTranscoder<ClassMetaData, String[]>()
.transcode(
finder.computeGraph(className),
new NodeConversionStrategy<ClassMetaData, String[]>() {
public String[] convert(
ClassMetaData input) {
try {
Graph<String[]> temp = new Graph<String[]>();
strategy
.convert(
temp,
urlClassLoader,
input
.getClassName());
return temp
.getUserData();
} catch (RuntimeException exc) {
throw new TranscodingException(
exc);
}
}
}), new File(output));
} else if (digest != null) {
File digestFile = new File(digest);
if (!digestFile.isAbsolute()) {
digestFile = new File(getProject().getBaseDir(), digest);
}
if (!digestFile.exists()) {
throw new IllegalArgumentException(
"Cannot continue, since digest file not found - "
+ digestFile.getAbsolutePath());
}
@SuppressWarnings("unchecked")
Map<String, ClassMetaData> map = (Map<String, ClassMetaData>) FileUtils
.loadSerializableObjectFromFile(digestFile);
System.out.println(getClass().getName()
+ ".execute. classpathElements - " + classpathElements);
final URLClassLoader urlClassLoader = ClassUtils
.newURLClassLoader(classpathElements, null);
final ClassHierarchyProcessor finder = new ClassHierarchyProcessor(
urlClassLoader, map);
@SuppressWarnings("unused")
final Repository repository = new ClassLoaderRepository(
urlClassLoader);
final ClassRenderingStrategy strategy = DefaultClassRenderingStrategy.SHOW_ALL_DECLARED_METHODS;
CallGraphGeneratorUtils
.draw(
new GraphTranscoder<ClassMetaData, String[]>()
.transcode(
finder.computeGraph(className),
new NodeConversionStrategy<ClassMetaData, String[]>() {
public String[] convert(
ClassMetaData input) {
try {
Graph<String[]> temp = new Graph<String[]>();
strategy
.convert(
temp,
urlClassLoader,
input
.getClassName());