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

Java JDKArchive类代码示例

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

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



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

示例1: toTag

import com.sun.tools.jdeps.PlatformClassPath.JDKArchive; //导入依赖的package包/类
/**
 * If the given archive is JDK archive, this method returns the profile name
 * only if -profile option is specified; it accesses a private JDK API and
 * the returned value will have "JDK internal API" prefix
 *
 * For non-JDK archives, this method returns the file name of the archive.
 */
private String toTag(String name, Archive source, Analyzer.Type type) {
    if (!isJDKArchive(source)) {
        return source.getName();
    }

    JDKArchive jdk = (JDKArchive)source;
    boolean isExported = false;
    if (type == CLASS || type == VERBOSE) {
        isExported = jdk.isExported(name);
    } else {
        isExported = jdk.isExportedPackage(name);
    }
    Profile p = getProfile(name, type);
    if (isExported) {
        // exported API
        return options.showProfile && p != null ? p.profileName() : "";
    } else {
        return "JDK internal API (" + source.getName() + ")";
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:JdepsTask.java


示例2: visit

import com.sun.tools.jdeps.PlatformClassPath.JDKArchive; //导入依赖的package包/类
@Override
public void visit(Location o, Location t) {
    Archive targetArchive = findArchive(t);
    if (filter.accepts(o, archive, t, targetArchive)) {
        addDep(o, t);
        if (!requires.contains(targetArchive)) {
            requires.add(targetArchive);
        }
    }
    if (targetArchive instanceof JDKArchive) {
        Profile p = Profile.getProfile(t.getPackageName());
        if (profile == null || (p != null && p.compareTo(profile) > 0)) {
            profile = p;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:Analyzer.java


示例3: visit

import com.sun.tools.jdeps.PlatformClassPath.JDKArchive; //导入依赖的package包/类
@Override
public void visit(Location o, Location t) {
    Archive targetArchive = findArchive(t);
    if (filter.accepts(o, archive, t, targetArchive)) {
        addDep(o, t);
        if (archive != targetArchive && !requires.contains(targetArchive)) {
            requires.add(targetArchive);
        }
    }
    if (targetArchive instanceof JDKArchive) {
        Profile p = Profile.getProfile(t.getPackageName());
        if (profile == null || (p != null && p.compareTo(profile) > 0)) {
            profile = p;
        }
    }
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:17,代码来源:Analyzer.java


示例4: visitDependence

import com.sun.tools.jdeps.PlatformClassPath.JDKArchive; //导入依赖的package包/类
@Override
public void visitDependence(String origin, Archive source,
                            String target, Archive archive, Profile profile) {
    if (options.findJDKInternals &&
            !(archive instanceof JDKArchive && profile == null)) {
        // filter dependences other than JDK internal APIs
        return;
    }
    if (options.verbose == Analyzer.Type.VERBOSE) {
        writer.format("   %-50s -> %-50s %s%n",
                      origin, target, getProfileArchiveInfo(archive, profile));
    } else {
        if (!origin.equals(pkg)) {
            pkg = origin;
            writer.format("   %s (%s)%n", origin, source.getFileName());
        }
        writer.format("      -> %-50s %s%n",
                      target, getProfileArchiveInfo(archive, profile));
    }
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:21,代码来源:JdepsTask.java


示例5: run

import com.sun.tools.jdeps.PlatformClassPath.JDKArchive; //导入依赖的package包/类
private boolean run() throws IOException {
    // parse classfiles and find all dependencies
    findDependencies();

    Analyzer analyzer = new Analyzer(options.verbose, new Analyzer.Filter() {
        @Override
        public boolean accepts(Location origin, Archive originArchive,
                               Location target, Archive targetArchive)
        {
            if (options.findJDKInternals) {
                // accepts target that is JDK class but not exported
                return isJDKArchive(targetArchive) &&
                          !((JDKArchive) targetArchive).isExported(target.getClassName());
            } else if (options.filterSameArchive) {
                // accepts origin and target that from different archive
                return originArchive != targetArchive;
            }
            return true;
        }
    });

    // analyze the dependencies
    analyzer.run(sourceLocations);

    // output result
    if (options.dotOutputDir != null) {
        Path dir = Paths.get(options.dotOutputDir);
        Files.createDirectories(dir);
        generateDotFiles(dir, analyzer);
    } else {
        printRawOutput(log, analyzer);
    }

    if (options.findJDKInternals && !options.nowarning) {
        showReplacements(analyzer);
    }
    return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:JdepsTask.java


示例6: visitDependence

import com.sun.tools.jdeps.PlatformClassPath.JDKArchive; //导入依赖的package包/类
@Override
public void visitDependence(String origin, Archive originArchive,
                            String target, Archive targetArchive) {
    writer.format("%s -> %s", originArchive.getName(), targetArchive.getPathName());
    if (options.showProfile && JDKArchive.isProfileArchive(targetArchive)) {
        writer.format(" (%s)", target);
    }
    writer.format("%n");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:JdepsTask.java


示例7: getProfileArchiveInfo

import com.sun.tools.jdeps.PlatformClassPath.JDKArchive; //导入依赖的package包/类
/**
 * If the given archive is JDK archive and non-null Profile,
 * this method returns the profile name only if -profile option is specified;
 * a null profile indicates it accesses a private JDK API and this method
 * will return "JDK internal API".
 *
 * For non-JDK archives, this method returns the file name of the archive.
 */
private String getProfileArchiveInfo(Archive source, Profile profile) {
    if (options.showProfile && profile != null)
        return profile.toString();

    if (source instanceof JDKArchive) {
        return profile == null ? "JDK internal API (" + source.getFileName() + ")" : "";
    }
    return source.getFileName();
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:18,代码来源:JdepsTask.java


示例8: profileName

import com.sun.tools.jdeps.PlatformClassPath.JDKArchive; //导入依赖的package包/类
/**
 * Returns the profile name or "JDK internal API" for JDK archive;
 * otherwise empty string.
 */
private String profileName(Archive archive, Profile profile) {
    if (archive instanceof JDKArchive) {
        return Objects.toString(profile, "JDK internal API");
    } else {
        return "";
    }
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:12,代码来源:JdepsTask.java


示例9: visitArchiveDependence

import com.sun.tools.jdeps.PlatformClassPath.JDKArchive; //导入依赖的package包/类
@Override
public void visitArchiveDependence(Archive origin, Archive target, Profile profile) {
    // add an edge with the archive's name with no tag
    // so that there is only one node for each JDK archive
    // while there may be edges to different profiles
    Edge e = addEdge(origin, target, "");
    if (target instanceof JDKArchive) {
        // add a label to print the profile
        if (profile == null) {
            e.addLabel("JDK internal API");
        } else if (options.showProfile && !options.showLabel) {
            e.addLabel(profile.toString());
        }
    }
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:16,代码来源:JdepsTask.java


示例10: add

import com.sun.tools.jdeps.PlatformClassPath.JDKArchive; //导入依赖的package包/类
void add(String origin, String target, Archive targetArchive, String pkgName) {
    SortedSet<Dep> set = deps.get(origin);
    if (set == null) {
        deps.put(origin, set = new TreeSet<>());
    }
    Profile p = targetArchive instanceof JDKArchive
                    ? Profile.getProfile(pkgName) : null;
    set.add(new Dep(target, targetArchive, p));
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:10,代码来源:Analyzer.java


示例11: isJDKArchive

import com.sun.tools.jdeps.PlatformClassPath.JDKArchive; //导入依赖的package包/类
/**
 * Test if the given archive is part of the JDK
 */
private boolean isJDKArchive(Archive archive) {
    return JDKArchive.class.isInstance(archive);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:JdepsTask.java


示例12: getTargetProfile

import com.sun.tools.jdeps.PlatformClassPath.JDKArchive; //导入依赖的package包/类
Profile getTargetProfile(Archive target) {
    return JDKArchive.isProfileArchive(target) ? profile : null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:Analyzer.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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