本文整理汇总了Java中jdepend.framework.JDepend.analyze方法的典型用法代码示例。如果您正苦于以下问题:Java JDepend.analyze方法的具体用法?Java JDepend.analyze怎么用?Java JDepend.analyze使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdepend.framework.JDepend
的用法示例。
在下文中一共展示了JDepend.analyze方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: of
import jdepend.framework.JDepend; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static PackageAnalyser of(File classDir, final String packagePrefix) {
final PackageFilter filter = new PackageFilter() {
@Override
public boolean accept(String name) {
return name.startsWith(packagePrefix);
}
};
final JDepend depend = new JDepend(filter);
try {
depend.addDirectory(classDir.getPath());
} catch (final IOException e) {
throw new RuntimeException(e);
}
final Collection<JavaPackage> packages = depend.analyze();
return new PackageAnalyser(packages);
}
示例2: runJDepend
import jdepend.framework.JDepend; //导入方法依赖的package包/类
/**
* @param treeObjects not null
* @return non null list
*/
protected List<JavaPackage> runJDepend(JDepend jdepend, TreeObject[] treeObjects) {
for (int i = 0; i < treeObjects.length; i++) {
try {
if(!treeObjects[i].isLeaf()){
TreeFolder folder = (TreeFolder)treeObjects[i];
// add roots
ArrayList<String> dirs = folder.getClassesLocation();
for (int j = 0; j < dirs.size(); j++) {
jdepend.addDirectory("" + dirs.get(j)); //$NON-NLS-1$
}
}
} catch (Exception e) {
// if directory doesn't exist, may be project need to be rebuild
JDepend4EclipsePlugin.handle(e);
}
}
final List<?> packages = new ArrayList<Object>(jdepend.analyze());
List<JavaPackage> filteredPackages = filterPackages(packages, jdepend);
Collections.sort(filteredPackages, new PackageComparator(PackageComparator.byName()));
return filteredPackages;
}
示例3: jdependProvider
import jdepend.framework.JDepend; //导入方法依赖的package包/类
@DataProvider(name = "jdependProvider")
@SuppressWarnings("checkstyle:multiplestringliterals")
public Object[][] jdependProvider() throws IOException {
final String[] configs = {"main", "test", "regr", "integ", "task"};
final Object[][] jdepends = new Object[configs.length][2];
for (int i = 0; i < configs.length; i += 1) {
final String config = configs[i];
try {
final JDepend jdepend = new JDepend();
addConfigDir(jdepend, config);
if (!"main".equals(config) && !"task".equals(config)) {
addConfigDir(jdepend, "main");
}
jdepend.analyze();
jdepends[i][0] = jdepend;
jdepends[i][1] = config;
}
catch (final IOException exception) {
log.error("Failed to initialize config [{}]", config, exception);
throw exception;
}
}
return jdepends;
}
示例4: setUp
import jdepend.framework.JDepend; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
// Get the classes root directory
String rootDirectory = getClass().getResource("/").getFile();
// Setup the JDepend analysis
engine = new JDepend();
engine.addDirectory(rootDirectory);
engine.analyze();
}
示例5: initJdepend
import jdepend.framework.JDepend; //导入方法依赖的package包/类
/**
* Initializes {@link #jdepend}.
*
* @throws IOException when initialization fails
*/
@Before
public void initJdepend() throws IOException {
jdepend = new JDepend();
jdepend.addDirectory("target/classes");
jdepend.analyze();
}
示例6: initJdepend
import jdepend.framework.JDepend; //导入方法依赖的package包/类
/**
* Initializes {@link JDepend}.
*
* @throws IOException when initialization fails
*/
@Before
public void initJdepend() throws IOException {
jdepend = new JDepend();
jdepend.addDirectory("target/classes");
jdepend.analyze();
}
示例7: generateOverviewSummary
import jdepend.framework.JDepend; //导入方法依赖的package包/类
private static void generateOverviewSummary(RootDoc root, ClassDocGraph graph, File outputDirectory) throws IOException {
final Map<String, PackageDoc> packages = getPackages(root);
PackageFilter packageFilter = PackageFilter.all();
for (Map.Entry<String, PackageDoc> entry : packages.entrySet()) {
String packageName = entry.getKey();
PackageDoc p = entry.getValue();
if (!ClassDocGraph.isHidden(p)) {
packageFilter.including(packageName);
}
}
JDepend jdepend = new JDepend(packageFilter.excludingRest());
File[] classPath = getClassPath(root.options());
for (File e: classPath) {
if (e.isDirectory()) {
root.printNotice(
"Included into dependency analysis: " + e);
jdepend.addDirectory(e.toString());
} else {
root.printNotice(
"Excluded from dependency analysis: " + e);
}
}
jdepend.analyze();
if (checkClasspathOption(root, jdepend)) {
instrumentDiagram(
root, outputDirectory, "overview-summary",
graph.getOverviewSummaryDiagram(jdepend));
} else {
root.printWarning(
"Please make sure that the '" +
OPTION_SOURCE_CLASS_PATH +
"' option was specified correctly.");
root.printWarning(
"Package dependency diagram will not be generated " +
"to avoid the inaccurate result.");
}
}
示例8: init
import jdepend.framework.JDepend; //导入方法依赖的package包/类
@BeforeClass
public static void init() throws IOException {
depend = new JDepend(PackageFilter.all().including("ch.docksnet").excludingRest());
depend.addDirectory("out/production/intellij-reference-diagram");
depend.analyze();
}