Search in sources :

Example 6 with PackageDoc

use of com.sun.javadoc.PackageDoc in project com.revolsys.open by revolsys.

the class ClientDoclet method navbar.

@Override
public void navbar() {
    DocletUtil.navbarStart(this.writer, this.docTitle);
    for (final PackageDoc packageDoc : this.root.specifiedPackages()) {
        navMenus(getAnnotations(packageDoc));
        navMenus(getEnums(packageDoc));
        navMenus(getInterfaces(packageDoc));
        navMenus(getClasses(packageDoc));
    }
    DocletUtil.navbarEnd(this.writer);
}
Also used : PackageDoc(com.sun.javadoc.PackageDoc)

Example 7 with PackageDoc

use of com.sun.javadoc.PackageDoc in project com.revolsys.open by revolsys.

the class RestDoclet method navbar.

@Override
public void navbar() {
    DocletUtil.navbarStart(this.writer, this.docTitle);
    for (final PackageDoc packageDoc : this.root.specifiedPackages()) {
        final Map<String, ClassDoc> classes = new TreeMap<>();
        for (final ClassDoc classDoc : packageDoc.ordinaryClasses()) {
            classes.put(classDoc.name(), classDoc);
        }
        for (final ClassDoc classDoc : classes.values()) {
            navMenu(classDoc);
        }
    }
    DocletUtil.navbarEnd(this.writer);
}
Also used : PackageDoc(com.sun.javadoc.PackageDoc) TreeMap(java.util.TreeMap) ClassDoc(com.sun.javadoc.ClassDoc)

Example 8 with PackageDoc

use of com.sun.javadoc.PackageDoc in project com.revolsys.open by revolsys.

the class DocletUtil method seeTag.

public static void seeTag(final StringBuilder text, final ClassDoc containingClass, final SeeTag seeTag) {
    final String name = seeTag.name();
    if (name.startsWith("@link") || name.equals("@see")) {
        final boolean code = !name.equalsIgnoreCase("@linkplain");
        String label = seeTag.label();
        final StringBuffer stringbuffer = new StringBuffer();
        final String seeTagText = replaceDocRootDir(seeTag.text());
        if (seeTagText.startsWith("<") || seeTagText.startsWith("\"")) {
            stringbuffer.append(seeTagText);
            text.append(seeTagText);
        } else {
            final ClassDoc referencedClass = seeTag.referencedClass();
            final MemberDoc referencedMember = seeTag.referencedMember();
            String referencedMemberName = seeTag.referencedMemberName();
            if (referencedClass == null) {
                final PackageDoc packagedoc = seeTag.referencedPackage();
                if (packagedoc != null && packagedoc.isIncluded()) {
                    final String packageName = packagedoc.name();
                    if (!StringUtils.hasText(label)) {
                        label = packageName;
                    }
                    link(text, "#" + packageName, label, code);
                } else {
                // TODO link to external package or class
                // String s9 = getCrossPackageLink(referencedClassName);
                // String s8;
                // if (s9 != null)
                // stringbuffer.append(getHyperLink(s9, "", s1.length() != 0 ? s1
                // : s3, false));
                // else if ((s8 = getCrossClassLink(referencedClassName,
                // referencedMemberName, s1, false, "", !plainLink)) != null) {
                // stringbuffer.append(s8);
                // } else {
                // configuration.getDocletSpecificMsg().warning(seeTag.position(),
                // "doclet.see.class_or_package_not_found", name, s2);
                // stringbuffer.append(s1.length() != 0 ? s1 : s3);
                // }
                }
            } else {
                String url = null;
                final String className = referencedClass.qualifiedName();
                if (referencedClass.isIncluded()) {
                    url = "#" + className;
                } else {
                    url = getExternalUrl(className);
                    if (!StringUtils.hasText(url)) {
                        label = className;
                    }
                }
                if (referencedMember != null) {
                    if (referencedMember instanceof ExecutableMemberDoc) {
                        if (referencedMemberName.indexOf('(') < 0) {
                            final ExecutableMemberDoc executableDoc = (ExecutableMemberDoc) referencedMember;
                            referencedMemberName = referencedMemberName + executableDoc.signature();
                        }
                        if (StringUtils.hasText(referencedMemberName)) {
                            label = referencedMemberName;
                        } else {
                            label = seeTagText;
                        }
                    }
                    if (referencedClass.isIncluded()) {
                        url += "." + referencedMemberName;
                    } else if (StringUtils.hasText(url)) {
                        url += "#" + referencedMemberName;
                    } else {
                        label = referencedMember.toString();
                    }
                }
                if (!StringUtils.hasText(label)) {
                    label = referencedClass.name();
                }
                link(text, url, label, code);
            }
        }
    }
}
Also used : PackageDoc(com.sun.javadoc.PackageDoc) ExecutableMemberDoc(com.sun.javadoc.ExecutableMemberDoc) MemberDoc(com.sun.javadoc.MemberDoc) ExecutableMemberDoc(com.sun.javadoc.ExecutableMemberDoc) ClassDoc(com.sun.javadoc.ClassDoc)

Example 9 with PackageDoc

use of com.sun.javadoc.PackageDoc in project com.revolsys.open by revolsys.

the class DocletUtil method seeTag.

public static void seeTag(final XmlWriter writer, final ClassDoc containingClass, final SeeTag seeTag) {
    final String name = seeTag.name();
    if (name.startsWith("@link") || name.equals("@see")) {
        final boolean code = !name.equalsIgnoreCase("@linkplain");
        String label = seeTag.label();
        final StringBuffer stringbuffer = new StringBuffer();
        final String seeTagText = replaceDocRootDir(seeTag.text());
        if (seeTagText.startsWith("<") || seeTagText.startsWith("\"")) {
            stringbuffer.append(seeTagText);
            writer.write(seeTagText);
        } else {
            final ClassDoc referencedClass = seeTag.referencedClass();
            final MemberDoc referencedMember = seeTag.referencedMember();
            String referencedMemberName = seeTag.referencedMemberName();
            if (referencedClass == null) {
                final PackageDoc packagedoc = seeTag.referencedPackage();
                if (packagedoc != null && packagedoc.isIncluded()) {
                    final String packageName = packagedoc.name();
                    if (!StringUtils.hasText(label)) {
                        label = packageName;
                    }
                    link(writer, "#" + packageName, label, code);
                } else {
                // TODO link to external package or class
                // String s9 = getCrossPackageLink(referencedClassName);
                // String s8;
                // if (s9 != null)
                // stringbuffer.append(getHyperLink(s9, "", s1.length() != 0 ? s1
                // : s3, false));
                // else if ((s8 = getCrossClassLink(referencedClassName,
                // referencedMemberName, s1, false, "", !plainLink)) != null) {
                // stringbuffer.append(s8);
                // } else {
                // configuration.getDocletSpecificMsg().warning(seeTag.position(),
                // "doclet.see.class_or_package_not_found", name, s2);
                // stringbuffer.append(s1.length() != 0 ? s1 : s3);
                // }
                }
            } else {
                String url = null;
                final String className = referencedClass.qualifiedName();
                if (referencedClass.isIncluded()) {
                    url = "#" + className;
                } else {
                    url = getExternalUrl(className);
                    if (!StringUtils.hasText(url)) {
                        label = className;
                    }
                }
                if (referencedMember != null) {
                    if (referencedMember instanceof ExecutableMemberDoc) {
                        if (referencedMemberName.indexOf('(') < 0) {
                            final ExecutableMemberDoc executableDoc = (ExecutableMemberDoc) referencedMember;
                            referencedMemberName = referencedMemberName + executableDoc.signature();
                        }
                        if (StringUtils.hasText(referencedMemberName)) {
                            label = referencedMemberName;
                        } else {
                            label = seeTagText;
                        }
                    }
                    if (referencedClass.isIncluded()) {
                        url += "." + referencedMemberName;
                    } else if (StringUtils.hasText(url)) {
                        url += "#" + referencedMemberName;
                    } else {
                        label = referencedMember.toString();
                    }
                }
                if (!StringUtils.hasText(label)) {
                    label = referencedClass.name();
                }
                link(writer, url, label, code);
            }
        }
    }
}
Also used : PackageDoc(com.sun.javadoc.PackageDoc) ExecutableMemberDoc(com.sun.javadoc.ExecutableMemberDoc) MemberDoc(com.sun.javadoc.MemberDoc) ExecutableMemberDoc(com.sun.javadoc.ExecutableMemberDoc) ClassDoc(com.sun.javadoc.ClassDoc)

Example 10 with PackageDoc

use of com.sun.javadoc.PackageDoc in project markdown-doclet by Abnaxos.

the class MarkdownDoclet method process.

/**
 * Process the documentation tree. If any errors occur during processing,
 * {@link #isError()} will return `true` afterwards.
 */
public void process() {
    processOverview();
    for (ClassDoc doc : rootDoc.classes()) {
        packages.add(doc.containingPackage());
        processClass(doc);
    }
    for (PackageDoc doc : packages) {
        processPackage(doc);
    }
}
Also used : PackageDoc(com.sun.javadoc.PackageDoc) ClassDoc(com.sun.javadoc.ClassDoc)

Aggregations

PackageDoc (com.sun.javadoc.PackageDoc)10 ClassDoc (com.sun.javadoc.ClassDoc)5 ExecutableMemberDoc (com.sun.javadoc.ExecutableMemberDoc)2 MemberDoc (com.sun.javadoc.MemberDoc)2 ProgramElementDoc (com.sun.javadoc.ProgramElementDoc)2 TreeMap (java.util.TreeMap)2 RootDoc (com.sun.javadoc.RootDoc)1 File (java.io.File)1 IOException (java.io.IOException)1 SourceStringReader (net.sourceforge.plantuml.SourceStringReader)1 Defines (net.sourceforge.plantuml.preproc.Defines)1