• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PackageFilter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中jdepend.framework.PackageFilter的典型用法代码示例。如果您正苦于以下问题:Java PackageFilter类的具体用法?Java PackageFilter怎么用?Java PackageFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PackageFilter类属于jdepend.framework包,在下文中一共展示了PackageFilter类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: of

import jdepend.framework.PackageFilter; //导入依赖的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: getJDependInstance

import jdepend.framework.PackageFilter; //导入依赖的package包/类
public static JDepend getJDependInstance() {
    PackageFilter filter = new PackageFilter();
    IPreferenceStore settings = getDefault().getPreferenceStore();
    if (settings.getBoolean(JDependConstants.PREF_USE_FILTERS)) {
        String[] strings =
                parseList(settings.getString(JDependConstants.PREF_ACTIVE_FILTERS_LIST));
        for (String name : strings) {
            if (name.endsWith(".*")) {
                name = name.substring(0, name.length()-2);
            }
            filter.addPackage(name);
        }
    }
    JDepend jdepend = new JDepend(filter);
    return jdepend;
}
 
开发者ID:iloveeclipse,项目名称:jdepend4eclipse,代码行数:17,代码来源:JDepend4EclipsePlugin.java


示例3: createJDependProcessor

import jdepend.framework.PackageFilter; //导入依赖的package包/类
/**
 * Create processor running jdepend analyze
 *
 * @param sw destination writer for jdepend analyze,
 *   results of the jdepend analyze are written here
 * @return JDependProcessorXML created jdepend processor
 */
protected JDependProcessorXML2 createJDependProcessor(Writer sw ) {
    
    // read settings from JDependSettings
    
    // (1) setup the filter packages
    final PackageFilter fp = new PackageFilter();
    final JDependSettings settings = JDependSettings.getDefault();
    String[] filterPackages = settings.getFilterPackages();
    for (int i = 0; i < filterPackages.length; i++ ) {
        final String filterPackage = filterPackages[i];
        fp.addPackage( filterPackage );
    }
    // (2) analyze inner classes flag
    final boolean analyzeInnerClasses = settings.getAnalyzerInnerClasses();
    
    // (3) Create a print writer
    final PrintWriter pw = new PrintWriter(sw);
    
    // (3) create the processor
    final JDependProcessorXML2 jdp = new JDependProcessorXML2(pw);
    // (3.1) set options
    jdp.analyzeInnerClasses( analyzeInnerClasses );
    jdp.setFilter( fp );
    
    return jdp;
}
 
开发者ID:bernhardhuber,项目名称:netbeansplugins,代码行数:34,代码来源:JDependTask.java


示例4: analyze

import jdepend.framework.PackageFilter; //导入依赖的package包/类
/**
 * @return result of JDepend run, never null
 */
public List<JavaPackage> analyze(TreeFolder newRoot, IResource[] resource) {
    resourceMap.clear();
    if (resource == null) {
        return new ArrayList<JavaPackage>();
    }

    JDepend jdepend =  JDepend4EclipsePlugin.getJDependInstance();
    PackageFilter filter = jdepend.getFilter();

    for (int i = 0; i < resource.length; i++) {
        TreeFolder [] tp = createTree(resource[i], filter);
        for (int j = 0; j < tp.length; j++) {
            // tree object check if child is exist
            if(tp[j].hasChildren()) {
                newRoot.addChild(tp[j]);
            }
        }
    }
    List<JavaPackage> packages = runJDepend(jdepend, newRoot.getChildren());
    // update cycle info
    // set cycle to true, if one of packages is under the founded tree root
    for (int j = 0; j < packages.size(); j++) {
        JavaPackage jp = packages.get(j);
        boolean cycle = jp.containsCycle();
        if(cycle){
            if(jp.getName().length() == 0){
                newRoot.setContainsCycle(cycle);
                continue;
            }
            TreeObject child = newRoot.findChild(jp);
            if(child != null && !child.isLeaf()){
                ((TreeFolder)child).setContainsCycle(cycle);
            }
        }
    }
    return packages;
}
 
开发者ID:iloveeclipse,项目名称:jdepend4eclipse,代码行数:41,代码来源:PackageTreeView.java


示例5: filterPackages

import jdepend.framework.PackageFilter; //导入依赖的package包/类
private static List<JavaPackage> filterPackages(List<?> packages, JDepend jdepend){
    ArrayList<JavaPackage> filteredPackages = new ArrayList<JavaPackage>();
    PackageFilter filter = jdepend.getFilter();
    for (int i = 0; i < packages.size(); i++) {
        JavaPackage tempPackage = (JavaPackage)packages.get(i);
        if(filter.accept(tempPackage.getName())){
            filteredPackages.add(tempPackage);
        }
    }
    return filteredPackages;
}
 
开发者ID:iloveeclipse,项目名称:jdepend4eclipse,代码行数:12,代码来源:PackageTreeView.java


示例6: generateOverviewSummary

import jdepend.framework.PackageFilter; //导入依赖的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


示例7: init

import jdepend.framework.PackageFilter; //导入依赖的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


示例8: setFilter

import jdepend.framework.PackageFilter; //导入依赖的package包/类
/**
 * Sets the package filter.
 *
 * @param filter Package filter.
 */
public void setFilter(PackageFilter filter) {
    analyzer.setFilter(filter);
}
 
开发者ID:bernhardhuber,项目名称:netbeansplugins,代码行数:9,代码来源:JDependProcessor.java


示例9: setFilter

import jdepend.framework.PackageFilter; //导入依赖的package包/类
/**
 * Sets the package filter.
 * 
 * @param filter Package filter.
 */
public void setFilter(PackageFilter filter) {
    analyzer.setFilter(filter);
}
 
开发者ID:kinneerc,项目名称:giv-planner,代码行数:9,代码来源:JDepend.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java KubernetesList类代码示例发布时间:2022-05-23
下一篇:
Java XalanConstants类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap