SeeTagImpl(DocImpl holder, String name, String text) { super(holder, name, text); parseSeeString(); if (where != null) { ClassDocImpl container = null; if (holder instanceof MemberDoc) { container = (ClassDocImpl)((ProgramElementDoc)holder).containingClass(); } else if (holder instanceof ClassDoc) { container = (ClassDocImpl)holder; } findReferenced(container); if (showRef) showRef(); } }
/** * Is given doc item visible in given classdoc in terms fo inheritance? * The given doc item is visible in the given classdoc if it is public * or protected and if it is package-private if it's containing class * is in the same package as the given classdoc. */ private boolean memberIsVisible(ProgramElementDoc pgmdoc) { if (pgmdoc.containingClass().equals(classdoc)) { //Member is in class that we are finding visible members for. //Of course it is visible. return true; } else if (pgmdoc.isPrivate()) { //Member is in super class or implemented interface. //Private, so not inherited. return false; } else if (pgmdoc.isPackagePrivate()) { //Member is package private. Only return true if its class is in //same package. return pgmdoc.containingClass().containingPackage().equals( classdoc.containingPackage()); } else { //Public members are always inherited. return true; } }
public void printSrcLink( ProgramElementDoc d, String label ) { if( d == null ) { return; } ClassDoc cd = d.containingClass(); if( cd == null ) { //d must be a class doc since in has no containing class. cd = (ClassDoc) d; } StringBuilder href = new StringBuilder(); href.append( relativePath ); href.append( DocletConstants.SOURCE_OUTPUT_DIR_NAME ); href.append( DirectoryManager.getDirectoryPath( cd.containingPackage() ) ); href.append( cd.name() ).append( ".html#" ); href.append( SourceToHTMLConverter.getAnchorName( d ) ); printHyperLink( href.toString(), "", label, true ); }
/** * Is given doc item visible in given classdoc in terms fo inheritance? * The given doc item is visible in the given classdoc if it is public * or protected and if it is package-private if it's containing class * is in the same package as the given classdoc. */ private boolean memberIsVisible(ProgramElementDoc pgmdoc) { if (pgmdoc.containingClass().equals(classdoc)) { //Member is in class that we are finding visible members for. //Of course it is visible. return true; } else if (pgmdoc.isPrivate()) { //Member is in super class or implemented interface. //Private, so not inherited. return false; } else if (pgmdoc.isPackagePrivate()) { //Member is package private. Only return true if its class is in //same package. return pgmdoc.containingClass().containingPackage().equals( classdoc.containingPackage()); } else { //Public members are always inherited. return true; } }
/** Return true if c has a @hidden tag associated with it */ private boolean hidden(ProgramElementDoc c) { Tag tags[] = c.tags("hidden"); if (tags.length > 0) return true; tags = c.tags("view"); if (tags.length > 0) return true; Options opt; if(c instanceof ClassDoc) opt = optionProvider.getOptionsFor((ClassDoc) c); else opt = optionProvider.getOptionsFor(c.containingClass()); return opt.matchesHideExpression(c.toString()); }
/** Return true if c has a @hidden tag associated with it */ private boolean hidden(ProgramElementDoc c) { if (c.tags("hidden").length > 0 || c.tags("view").length > 0) return true; Options opt = optionProvider.getOptionsFor(c instanceof ClassDoc ? (ClassDoc) c : c.containingClass()); return opt.matchesHideExpression(c.toString()) // || (opt.hidePrivateInner && c instanceof ClassDoc && c.isPrivate() && ((ClassDoc) c).containingClass() != null); }
ClassDoc classDoc = (referenceDoc.isClass() || referenceDoc.isInterface()) ? (ClassDoc) referenceDoc : referenceDoc.containingClass();
((ProgramElementDoc) holder).containingClass(); final String className = getClassName(reference); if (StringUtils.isNotBlank(className))
for (Iterator<? extends ProgramElementDoc> it = members.iterator(); it.hasNext(); ) { ProgramElementDoc pgmdoc = it.next(); ClassDoc cd = pgmdoc.containingClass(); if (!printedUseTableHeader) {
/** * {@inheritDoc} */ public void inherit(DocFinder.Input input, DocFinder.Output output) { ClassDoc exception; if (input.tagId == null) { ThrowsTag throwsTag = (ThrowsTag) input.tag; exception = throwsTag.exception(); input.tagId = exception == null ? throwsTag.exceptionName() : throwsTag.exception().qualifiedName(); } else { exception = input.element.containingClass().findClass(input.tagId); } ThrowsTag[] tags = ((MethodDoc)input.element).throwsTags(); for (int i = 0; i < tags.length; i++) { if (input.tagId.equals(tags[i].exceptionName()) || (tags[i].exception() != null && (input.tagId.equals(tags[i].exception().qualifiedName())))) { output.holder = input.element; output.holderTag = tags[i]; output.inlineTags = input.isFirstSentence ? tags[i].firstSentenceTags() : tags[i].inlineTags(); output.tagList.add(tags[i]); } else if (exception != null && tags[i].exception() != null && tags[i].exception().subclassOf(exception)) { output.tagList.add(tags[i]); } } }
/** * Add the link to the content tree. * * @param doc program element doc for which the link will be added * @param label label for the link * @param htmltree the content tree to which the link will be added */ public void addSrcLink(ProgramElementDoc doc, Content label, Content htmltree) { if (doc == null) { return; } ClassDoc cd = doc.containingClass(); if (cd == null) { //d must be a class doc since in has no containing class. cd = (ClassDoc) doc; } DocPath href = pathToRoot .resolve(DocPaths.SOURCE_OUTPUT) .resolve(DocPath.forClass(cd)); Content linkContent = getHyperLink(href.fragment(SourceToHTMLConverter.getAnchorName(doc)), label, "", ""); htmltree.addContent(linkContent); }
protected void printIndexComment(Doc member, Tag[] firstSentenceTags) { Tag[] deprs = member.tags("deprecated"); if (Util.isDeprecated((ProgramElementDoc) member)) { strongText("doclet.Deprecated"); space(); if (deprs.length > 0) { printInlineDeprecatedComment(member, deprs[0]); } return; } else { ClassDoc cd = ((ProgramElementDoc)member).containingClass(); if (cd != null && Util.isDeprecated(cd)) { strongText("doclet.Deprecated"); space(); } } printSummaryComment(member, firstSentenceTags); }
/** * Print comment for each element in the index. If the element is deprecated * and it has a @deprecated tag, use that comment. Else if the containing * class for this element is deprecated, then add the word "Deprecated." at * the start and then print the normal comment. * * @param element Index element. */ protected void printComment(ProgramElementDoc element) { Tag[] tags; if (Util.isDeprecated(element)) { strongText("doclet.Deprecated"); space(); if ((tags = element.tags("deprecated")).length > 0) printInlineDeprecatedComment(element, tags[0]); } else { ClassDoc cont = element.containingClass(); while (cont != null) { if (Util.isDeprecated(cont)) { strongText("doclet.Deprecated"); space(); break; } cont = cont.containingClass(); } printSummaryComment(element); } }
for (int i = 0; it.hasNext(); i++) { ProgramElementDoc pgmdoc = it.next(); ClassDoc cd = pgmdoc.containingClass(); if (!printedUseTableHeader) { table.addContent(writer.getSummaryTableHeader(
contentTree.addContent(div); } else { ClassDoc cont = element.containingClass(); while (cont != null) { if (Util.isDeprecated(cont)) {
return; } else { ClassDoc cd = ((ProgramElementDoc)member).containingClass(); if (cd != null && Util.isDeprecated(cd)) { Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
int methodType = (member.isStatic()) ? MethodTypes.STATIC.value() : MethodTypes.INSTANCE.value(); if (member.containingClass().isInterface()) { methodType = (((MethodDoc) member).isAbstract()) ? methodType | MethodTypes.ABSTRACT.value()
if (!(member.containingClass().isInterface()) && ((MethodDoc)member).isAbstract()) { code.addContent("abstract ");