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


Java Profile.lookup方法代码示例

本文整理汇总了Java中com.sun.tools.javac.jvm.Profile.lookup方法的典型用法代码示例。如果您正苦于以下问题:Java Profile.lookup方法的具体用法?Java Profile.lookup怎么用?Java Profile.lookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.tools.javac.jvm.Profile的用法示例。


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

示例1: addProfilesList

import com.sun.tools.javac.jvm.Profile; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void addProfilesList(Content profileSummary, Content body) {
    Content h2 = HtmlTree.HEADING(HtmlTag.H2, profileSummary);
    Content profilesDiv = HtmlTree.DIV(h2);
    Content ul = new HtmlTree(HtmlTag.UL);
    String profileName;
    for (int i = 1; i < configuration.profiles.getProfileCount(); i++) {
        profileName = Profile.lookup(i).name;
        // If the profile has valid packages to be documented, add it to the
        // profiles list on overview-summary.html page.
        if (configuration.shouldDocumentProfile(profileName)) {
            Content profileLinkContent = getTargetProfileLink("classFrame",
                    new StringContent(profileName), profileName);
            Content li = HtmlTree.LI(profileLinkContent);
            ul.addContent(li);
        }
    }
    profilesDiv.addContent(ul);
    Content div = HtmlTree.DIV(HtmlStyle.contentContainer, profilesDiv);
    body.addContent(div);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:PackageIndexWriter.java

示例2: addProfilesList

import com.sun.tools.javac.jvm.Profile; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void addProfilesList(Profiles profiles, String text,
        String tableSummary, Content body) {
    Content heading = HtmlTree.HEADING(HtmlConstants.PROFILE_HEADING, true,
            profilesLabel);
    Content div = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
    HtmlTree ul = new HtmlTree(HtmlTag.UL);
    ul.setTitle(profilesLabel);
    String profileName;
    for (int i = 1; i < profiles.getProfileCount(); i++) {
        profileName = (Profile.lookup(i)).name;
        // If the profile has valid packages to be documented, add it to the
        // left-frame generated for profile index.
        if (configuration.shouldDocumentProfile(profileName))
            ul.addContent(getProfile(profileName));
    }
    div.addContent(ul);
    body.addContent(div);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:ProfileIndexFrameWriter.java

示例3: generate

import com.sun.tools.javac.jvm.Profile; //导入方法依赖的package包/类
/**
 * Generate a profile package summary page for the left-hand bottom frame. Construct
 * the ProfilePackageFrameWriter object and then uses it generate the file.
 *
 * @param configuration the current configuration of the doclet.
 * @param packageDoc The package for which "profilename-package-frame.html" is to be generated.
 * @param profileValue the value of the profile being documented
 */
public static void generate(ConfigurationImpl configuration,
        PackageDoc packageDoc, int profileValue) {
    ProfilePackageFrameWriter profpackgen;
    try {
        String profileName = Profile.lookup(profileValue).name;
        profpackgen = new ProfilePackageFrameWriter(configuration, packageDoc,
                profileName);
        StringBuilder winTitle = new StringBuilder(profileName);
        String sep = " - ";
        winTitle.append(sep);
        String pkgName = Util.getPackageName(packageDoc);
        winTitle.append(pkgName);
        Content body = profpackgen.getBody(false,
                profpackgen.getWindowTitle(winTitle.toString()));
        Content profName = new StringContent(profileName);
        Content sepContent = new StringContent(sep);
        Content pkgNameContent = new RawHtml(pkgName);
        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
                profpackgen.getTargetProfileLink("classFrame", profName, profileName));
        heading.addContent(sepContent);
        heading.addContent(profpackgen.getTargetProfilePackageLink(packageDoc,
                "classFrame", pkgNameContent, profileName));
        body.addContent(heading);
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
        div.addStyle(HtmlStyle.indexContainer);
        profpackgen.addClassListing(div, profileValue);
        body.addContent(div);
        profpackgen.printHtmlDocument(
                configuration.metakeywords.getMetaKeywords(packageDoc), false, body);
        profpackgen.close();
    } catch (IOException exc) {
        configuration.standardmessage.error(
                "doclet.exception_encountered",
                exc.toString(), DocPaths.PACKAGE_FRAME.getPath());
        throw new DocletAbortException(exc);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:ProfilePackageFrameWriter.java

示例4: getSupplementaryFlags

import com.sun.tools.javac.jvm.Profile; //导入方法依赖的package包/类
/**
 * Returns any extra flags for a class symbol.
 * This information used to be provided using private annotations
 * in the class file in ct.sym; in time, this information will be
 * available from the module system.
 */
long getSupplementaryFlags(ClassSymbol c) {
    if (jrtIndex == null || !jrtIndex.isInJRT(c.classfile) || c.name == names.module_info) {
        return 0;
    }

    if (supplementaryFlags == null) {
        supplementaryFlags = new HashMap<>();
    }

    Long flags = supplementaryFlags.get(c.packge());
    if (flags == null) {
        long newFlags = 0;
        try {
            JRTIndex.CtSym ctSym = jrtIndex.getCtSym(c.packge().flatName());
            Profile minProfile = Profile.DEFAULT;
            if (ctSym.proprietary)
                newFlags |= PROPRIETARY;
            if (ctSym.minProfile != null)
                minProfile = Profile.lookup(ctSym.minProfile);
            if (profile != Profile.DEFAULT && minProfile.value > profile.value) {
                newFlags |= NOT_IN_PROFILE;
            }
        } catch (IOException ignore) {
        }
        supplementaryFlags.put(c.packge(), flags = newFlags);
    }
    return flags;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:35,代码来源:ClassFinder.java

示例5: generateProfileFiles

import com.sun.tools.javac.jvm.Profile; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void generateProfileFiles() throws Exception {
    if (configuration.showProfiles && configuration.profilePackages.size() > 0) {
        ProfileIndexFrameWriter.generate(configuration);
        Profile prevProfile = null, nextProfile;
        String profileName;
        for (int i = 1; i < configuration.profiles.getProfileCount(); i++) {
            profileName = Profile.lookup(i).name;
            // Generate profile package pages only if there are any packages
            // in a profile to be documented. The profilePackages map will not
            // contain an entry for the profile if there are no packages to be documented.
            if (!configuration.shouldDocumentProfile(profileName))
                continue;
            ProfilePackageIndexFrameWriter.generate(configuration, profileName);
            PackageDoc[] packages = configuration.profilePackages.get(
                    profileName);
            PackageDoc prev = null, next;
            for (int j = 0; j < packages.length; j++) {
                // if -nodeprecated option is set and the package is marked as
                // deprecated, do not generate the profilename-package-summary.html
                // and profilename-package-frame.html pages for that package.
                if (!(configuration.nodeprecated && Util.isDeprecated(packages[j]))) {
                    ProfilePackageFrameWriter.generate(configuration, packages[j], i);
                    next = (j + 1 < packages.length
                            && packages[j + 1].name().length() > 0) ? packages[j + 1] : null;
                    AbstractBuilder profilePackageSummaryBuilder =
                            configuration.getBuilderFactory().getProfilePackageSummaryBuilder(
                            packages[j], prev, next, Profile.lookup(i));
                    profilePackageSummaryBuilder.build();
                    prev = packages[j];
                }
            }
            nextProfile = (i + 1 < configuration.profiles.getProfileCount()) ?
                    Profile.lookup(i + 1) : null;
            AbstractBuilder profileSummaryBuilder =
                    configuration.getBuilderFactory().getProfileSummaryBuilder(
                    Profile.lookup(i), prevProfile, nextProfile);
            profileSummaryBuilder.build();
            prevProfile = Profile.lookup(i);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:45,代码来源:HtmlDoclet.java


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