Java Code Examples for com.sun.tools.javac.jvm.Profile

The following examples show how to use com.sun.tools.javac.jvm.Profile. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * {@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);
}
 
Example 2
/**
 * {@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);
}
 
Example 3
void initTestClasses() {
    // The following table assumes the existence of specific classes
    // in specific profiles, as defined in the Java SE 8 spec.
    init(Profile.COMPACT1,
            java.lang.String.class);

    init(Profile.COMPACT2,
            javax.xml.XMLConstants.class);

    init(Profile.COMPACT3,
            javax.sql.rowset.Predicate.class,
            com.sun.security.auth.PolicyFile.class); // specifically included in 3

    init(Profile.DEFAULT,
            java.beans.BeanInfo.class,
            javax.management.remote.rmi._RMIServer_Stub.class); // specifically excluded in 3
}
 
Example 4
void initTestClasses() {
    // The following table assumes the existence of specific classes
    // in specific profiles, as defined in the Java SE 8 spec.
    init(Profile.COMPACT1,
            java.lang.String.class);

    init(Profile.COMPACT2,
            javax.xml.XMLConstants.class);

    //init(Profile.COMPACT3,
    //        javax.sql.rowset.Predicate.class,
    //        com.sun.security.auth.PolicyFile.class); // specifically included in 3

    init(Profile.COMPACT3,
            javax.sql.rowset.Predicate.class);

    init(Profile.DEFAULT,
            java.beans.BeanInfo.class);
}
 
Example 5
Source Project: jdk8u60   Source File: PackageIndexWriter.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * {@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);
}
 
Example 6
/**
 * {@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);
}
 
Example 7
Source Project: jdk8u60   Source File: ProfileOptionTest.java    License: GNU General Public License v2.0 6 votes vote down vote up
void initTestClasses() {
    // The following table assumes the existence of specific classes
    // in specific profiles, as defined in the Java SE 8 spec.
    init(Profile.COMPACT1,
            java.lang.String.class);

    init(Profile.COMPACT2,
            javax.xml.XMLConstants.class);

    init(Profile.COMPACT3,
            javax.sql.rowset.Predicate.class,
            com.sun.security.auth.PolicyFile.class); // specifically included in 3

    init(Profile.DEFAULT,
            java.beans.BeanInfo.class,
            javax.management.remote.rmi._RMIServer_Stub.class); // specifically excluded in 3
}
 
Example 8
Source Project: hottub   Source File: PackageIndexWriter.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * {@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);
}
 
Example 9
/**
 * {@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);
}
 
Example 10
/**
 * {@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);
}
 
Example 11
Source Project: hottub   Source File: ProfileOptionTest.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Test
void testClassesInProfiles() throws Exception {
    for (Profile p: Profile.values()) {
        for (Map.Entry<Profile, List<JavaFileObject>> e: testClasses.entrySet()) {
            for (JavaFileObject fo: e.getValue()) {
                DiagnosticCollector<JavaFileObject> dl =
                        new DiagnosticCollector<JavaFileObject>();
                List<String> opts = (p == Profile.DEFAULT)
                        ? Collections.<String>emptyList()
                        : Arrays.asList("-profile", p.name);
                JavacTask task = (JavacTask) javac.getTask(null, fm, dl, opts, null,
                        Arrays.asList(fo));
                task.analyze();

                List<String> expectDiagCodes = (p.value >= e.getKey().value)
                        ? Collections.<String>emptyList()
                        : Arrays.asList("compiler.err.not.in.profile");

                checkDiags(opts + " " + fo.getName(), dl.getDiagnostics(), expectDiagCodes);
            }
        }
    }
}
 
Example 12
void initTestClasses() {
    // The following table assumes the existence of specific classes
    // in specific profiles, as defined in the Java SE 8 spec.
    init(Profile.COMPACT1,
            java.lang.String.class);

    init(Profile.COMPACT2,
            javax.xml.XMLConstants.class);

    init(Profile.COMPACT3,
            javax.sql.rowset.Predicate.class,
            com.sun.security.auth.PolicyFile.class); // specifically included in 3

    init(Profile.DEFAULT,
            java.beans.BeanInfo.class,
            javax.management.remote.rmi._RMIServer_Stub.class); // specifically excluded in 3
}
 
Example 13
/**
 * Format a single argument of a given diagnostic.
 *
 * @param d diagnostic whose argument is to be formatted
 * @param arg argument to be formatted
 * @param l locale object to be used for i18n
 * @return string representation of the diagnostic argument
 */
protected String formatArgument(JCDiagnostic d, Object arg, Locale l) {
    if (arg instanceof JCDiagnostic) {
        String s = null;
        depth++;
        try {
            s = formatMessage((JCDiagnostic)arg, l);
        }
        finally {
            depth--;
        }
        return s;
    }
    else if (arg instanceof JCExpression) {
        return expr2String((JCExpression)arg);
    }
    else if (arg instanceof Iterable<?>) {
        return formatIterable(d, (Iterable<?>)arg, l);
    }
    else if (arg instanceof Type) {
        return printer.visit((Type)arg, l);
    }
    else if (arg instanceof Symbol) {
        return printer.visit((Symbol)arg, l);
    }
    else if (arg instanceof JavaFileObject) {
        return ((JavaFileObject)arg).getName();
    }
    else if (arg instanceof Profile) {
        return ((Profile)arg).name;
    }
    else if (arg instanceof Formattable) {
        return ((Formattable)arg).toString(l, messages);
    }
    else {
        return String.valueOf(arg);
    }
}
 
Example 14
Source Project: openjdk-8   Source File: MetaKeywords.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the profile keywords.
 *
 * @param profile the profile being documented
 */
public String[] getMetaKeywords(Profile profile) {
    if( configuration.keywords ) {
        String profileName = profile.name;
        return new String[] { profileName + " " + "profile" };
    } else {
        return new String[] {};
    }
}
 
Example 15
@Test
void testClassesInProfiles() throws Exception {
    for (Profile p: Profile.values()) {
        for (Map.Entry<Profile, List<JavaFileObject>> e: testClasses.entrySet()) {
            for (JavaFileObject fo: e.getValue()) {
                DiagnosticCollector<JavaFileObject> dl =
                        new DiagnosticCollector<JavaFileObject>();
                List<String> opts = (p == Profile.DEFAULT)
                        ? Collections.<String>emptyList()
                        : Arrays.asList("--release", "8", "-profile", p.name);
                JavacTask task = (JavacTask) javac.getTask(null, fm, dl, opts, null,
                        Arrays.asList(fo));
                task.analyze();

                List<String> expectDiagCodes = new ArrayList<>();
                if (fo.getName().equals("TPolicyFile.java")) {
                    expectDiagCodes.add("compiler.warn.has.been.deprecated.for.removal");
                }

                if (p.value < e.getKey().value) {
                    expectDiagCodes.add("compiler.err.not.in.profile");
                }

                checkDiags(opts + " " + fo.getName(), dl.getDiagnostics(), expectDiagCodes);
            }
        }
    }
}
 
Example 16
Source Project: TencentKona-8   Source File: MetaKeywords.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the profile keywords.
 *
 * @param profile the profile being documented
 */
public String[] getMetaKeywords(Profile profile) {
    if( configuration.keywords ) {
        String profileName = profile.name;
        return new String[] { profileName + " " + "profile" };
    } else {
        return new String[] {};
    }
}
 
Example 17
/**
 * Construct a new ProfilePackageSummaryBuilder.
 *
 * @param context  the build context.
 * @param pkg the profile package being documented.
 * @param profilePackageWriter the doclet specific writer that will output the
 *        result.
 * @param profile the profile being documented.
 */
private ProfilePackageSummaryBuilder(Context context,
        PackageDoc pkg, ProfilePackageSummaryWriter profilePackageWriter,
        Profile profile) {
    super(context);
    this.packageDoc = pkg;
    this.profilePackageWriter = profilePackageWriter;
    this.profileName = profile.name;
    this.profileValue = profile.value;
}
 
Example 18
void init(Profile p, Class<?>... classes) {
    List<JavaFileObject> srcs = new ArrayList<JavaFileObject>();
    for (Class<?> c: classes) {
        String name = "T" + c.getSimpleName();
        String src =
                "class T" + name + "{" + "\n" +
                "    Class<?> c = " + c.getName() + ".class;\n" +
                "}";
        srcs.add(new StringJavaFileObject(name + ".java", src));
    }
    testClasses.put(p, srcs);
}
 
Example 19
/**
 * Format a single argument of a given diagnostic.
 *
 * @param d diagnostic whose argument is to be formatted
 * @param arg argument to be formatted
 * @param l locale object to be used for i18n
 * @return string representation of the diagnostic argument
 */
protected String formatArgument(JCDiagnostic d, Object arg, Locale l) {
    if (arg instanceof JCDiagnostic) {
        String s = null;
        depth++;
        try {
            s = formatMessage((JCDiagnostic)arg, l);
        }
        finally {
            depth--;
        }
        return s;
    }
    else if (arg instanceof JCExpression) {
        return expr2String((JCExpression)arg);
    }
    else if (arg instanceof Iterable<?>) {
        return formatIterable(d, (Iterable<?>)arg, l);
    }
    else if (arg instanceof Type) {
        return printer.visit((Type)arg, l);
    }
    else if (arg instanceof Symbol) {
        return printer.visit((Symbol)arg, l);
    }
    else if (arg instanceof JavaFileObject) {
        return ((JavaFileObject)arg).getName();
    }
    else if (arg instanceof Profile) {
        return ((Profile)arg).name;
    }
    else if (arg instanceof Formattable) {
        return ((Formattable)arg).toString(l, messages);
    }
    else {
        return String.valueOf(arg);
    }
}
 
Example 20
void init(Profile p, Class<?>... classes) {
    List<JavaFileObject> srcs = new ArrayList<JavaFileObject>();
    for (Class<?> c: classes) {
        String name = "T" + c.getSimpleName();
        String src =
                "class T" + name + "{" + "\n" +
                "    Class<?> c = " + c.getName() + ".class;\n" +
                "}";
        srcs.add(new StringJavaFileObject(name + ".java", src));
    }
    testClasses.put(p, srcs);
}
 
Example 21
/**
 * Format a single argument of a given diagnostic.
 *
 * @param d diagnostic whose argument is to be formatted
 * @param arg argument to be formatted
 * @param l locale object to be used for i18n
 * @return string representation of the diagnostic argument
 */
protected String formatArgument(JCDiagnostic d, Object arg, Locale l) {
    if (arg instanceof JCDiagnostic) {
        String s = null;
        depth++;
        try {
            s = formatMessage((JCDiagnostic)arg, l);
        }
        finally {
            depth--;
        }
        return s;
    }
    else if (arg instanceof JCExpression) {
        return expr2String((JCExpression)arg);
    }
    else if (arg instanceof Iterable<?>) {
        return formatIterable(d, (Iterable<?>)arg, l);
    }
    else if (arg instanceof Type) {
        return printer.visit((Type)arg, l);
    }
    else if (arg instanceof Symbol) {
        return printer.visit((Symbol)arg, l);
    }
    else if (arg instanceof JavaFileObject) {
        return ((JavaFileObject)arg).getName();
    }
    else if (arg instanceof Profile) {
        return ((Profile)arg).name;
    }
    else if (arg instanceof Formattable) {
        return ((Formattable)arg).toString(l, messages);
    }
    else {
        return String.valueOf(arg);
    }
}
 
Example 22
/**
 * Format a single argument of a given diagnostic.
 *
 * @param d diagnostic whose argument is to be formatted
 * @param arg argument to be formatted
 * @param l locale object to be used for i18n
 * @return string representation of the diagnostic argument
 */
protected String formatArgument(JCDiagnostic d, Object arg, Locale l) {
    if (arg instanceof JCDiagnostic) {
        String s = null;
        depth++;
        try {
            s = formatMessage((JCDiagnostic)arg, l);
        }
        finally {
            depth--;
        }
        return s;
    }
    else if (arg instanceof JCExpression) {
        return expr2String((JCExpression)arg);
    }
    else if (arg instanceof Iterable<?>) {
        return formatIterable(d, (Iterable<?>)arg, l);
    }
    else if (arg instanceof Type) {
        return printer.visit((Type)arg, l);
    }
    else if (arg instanceof Symbol) {
        return printer.visit((Symbol)arg, l);
    }
    else if (arg instanceof JavaFileObject) {
        return ((JavaFileObject)arg).getName();
    }
    else if (arg instanceof Profile) {
        return ((Profile)arg).name;
    }
    else if (arg instanceof Formattable) {
        return ((Formattable)arg).toString(l, messages);
    }
    else {
        return String.valueOf(arg);
    }
}
 
Example 23
/**
 * 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);
    }
}
 
Example 24
Source Project: jdk8u60   Source File: MetaKeywords.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the profile keywords.
 *
 * @param profile the profile being documented
 */
public String[] getMetaKeywords(Profile profile) {
    if( configuration.keywords ) {
        String profileName = profile.name;
        return new String[] { profileName + " " + "profile" };
    } else {
        return new String[] {};
    }
}
 
Example 25
void init(Profile p, Class<?>... classes) {
    List<JavaFileObject> srcs = new ArrayList<JavaFileObject>();
    for (Class<?> c: classes) {
        String name = "T" + c.getSimpleName();
        String src =
                "class T" + name + "{" + "\n" +
                "    Class<?> c = " + c.getName() + ".class;\n" +
                "}";
        srcs.add(new StringJavaFileObject(name + ".java", src));
    }
    testClasses.put(p, srcs);
}
 
Example 26
Source Project: jdk8u60   Source File: ProfileOptionTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
void init(Profile p, Class<?>... classes) {
    List<JavaFileObject> srcs = new ArrayList<JavaFileObject>();
    for (Class<?> c: classes) {
        String name = "T" + c.getSimpleName();
        String src =
                "class T" + name + "{" + "\n" +
                "    Class<?> c = " + c.getName() + ".class;\n" +
                "}";
        srcs.add(new StringJavaFileObject(name + ".java", src));
    }
    testClasses.put(p, srcs);
}
 
Example 27
/**
 * Format a single argument of a given diagnostic.
 *
 * @param d diagnostic whose argument is to be formatted
 * @param arg argument to be formatted
 * @param l locale object to be used for i18n
 * @return string representation of the diagnostic argument
 */
protected String formatArgument(JCDiagnostic d, Object arg, Locale l) {
    if (arg instanceof JCDiagnostic) {
        String s = null;
        depth++;
        try {
            s = formatMessage((JCDiagnostic)arg, l);
        }
        finally {
            depth--;
        }
        return s;
    }
    else if (arg instanceof JCExpression) {
        return expr2String((JCExpression)arg);
    }
    else if (arg instanceof Iterable<?>) {
        return formatIterable(d, (Iterable<?>)arg, l);
    }
    else if (arg instanceof Type) {
        return printer.visit((Type)arg, l);
    }
    else if (arg instanceof Symbol) {
        return printer.visit((Symbol)arg, l);
    }
    else if (arg instanceof JavaFileObject) {
        return ((JavaFileObject)arg).getName();
    }
    else if (arg instanceof Profile) {
        return ((Profile)arg).name;
    }
    else if (arg instanceof Formattable) {
        return ((Formattable)arg).toString(l, messages);
    }
    else {
        return String.valueOf(arg);
    }
}
 
Example 28
/**
 * 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);
    }
}
 
Example 29
/**
 * Construct a new ProfilePackageSummaryBuilder.
 *
 * @param context  the build context.
 * @param pkg the profile package being documented.
 * @param profilePackageWriter the doclet specific writer that will output the
 *        result.
 * @param profile the profile being documented.
 */
private ProfilePackageSummaryBuilder(Context context,
        PackageDoc pkg, ProfilePackageSummaryWriter profilePackageWriter,
        Profile profile) {
    super(context);
    this.packageDoc = pkg;
    this.profilePackageWriter = profilePackageWriter;
    this.profileName = profile.name;
    this.profileValue = profile.value;
}
 
Example 30
void init(Profile p, Class<?>... classes) {
    List<JavaFileObject> srcs = new ArrayList<JavaFileObject>();
    for (Class<?> c: classes) {
        String name = "T" + c.getSimpleName();
        String src =
                "class T" + name + "{" + "\n" +
                "    Class<?> c = " + c.getName() + ".class;\n" +
                "}";
        srcs.add(new StringJavaFileObject(name + ".java", src));
    }
    testClasses.put(p, srcs);
}