当前位置: 首页>>代码示例>>Java>>正文


Java JDepend.analyze方法代码示例

本文整理汇总了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);
}
 
开发者ID:jerkar,项目名称:jerkar,代码行数:20,代码来源:PackageDependency.java

示例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;
}
 
开发者ID:iloveeclipse,项目名称:jdepend4eclipse,代码行数:27,代码来源:PackageTreeView.java

示例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;
}
 
开发者ID:universal-automata,项目名称:liblevenshtein-java,代码行数:25,代码来源:JDependIntegTest.java

示例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();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:13,代码来源:PackageDependenciesTest.java

示例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();
}
 
开发者ID:HeliosTeam,项目名称:jenkins-filesize-monitor,代码行数:13,代码来源:CyclicDependencyTest.java

示例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();
}
 
开发者ID:cyChop,项目名称:daily-tasks,代码行数:13,代码来源:CyclicDependenciesTest.java

示例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.");
    }
}
 
开发者ID:grahamedgecombe,项目名称:apiviz,代码行数:45,代码来源:APIviz.java

示例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();
}
 
开发者ID:Stefku,项目名称:intellij-reference-diagram,代码行数:7,代码来源:DependencyTest.java


注:本文中的jdepend.framework.JDepend.analyze方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。