/** * Determine if a doc item is externally documented. * * @param doc A ProgramElementDoc. */ public boolean isExternal(ProgramElementDoc doc) { if (packageToItemMap == null) { return false; } return packageToItemMap.get(doc.containingPackage().name()) != null; }
/** * @return The {@link PackageDoc} containing the given {@code doc}, or {@code null} iff {@code doc} is a * {@link RootDoc} */ @Nullable public static PackageDoc packageScope(Doc doc) { return ( doc instanceof PackageDoc ? (PackageDoc) doc : doc instanceof ProgramElementDoc ? ((ProgramElementDoc) doc).containingPackage() : null ); }
/** * @return The {@link PackageDoc} containing the given <var>doc</var>, or {@code null} iff <var>doc</var> is a * {@link RootDoc} */ @Nullable public static PackageDoc packageScope(Doc doc) { return ( doc instanceof PackageDoc ? (PackageDoc) doc : doc instanceof ProgramElementDoc ? ((ProgramElementDoc) doc).containingPackage() : null ); }
/** * Determine if a doc item is externally documented. * * @param doc A ProgramElementDoc. */ public boolean isExternal(ProgramElementDoc doc) { if (packageToItemMap == null) { return false; } return packageToItemMap.get(doc.containingPackage().name()) != null; }
private Map<String,List<ProgramElementDoc>> pkgDivide(Map<String,? extends List<? extends ProgramElementDoc>> classMap) { Map<String,List<ProgramElementDoc>> map = new HashMap<String,List<ProgramElementDoc>>(); List<? extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName()); if (list != null) { Collections.sort(list); Iterator<? extends ProgramElementDoc> it = list.iterator(); while (it.hasNext()) { ProgramElementDoc doc = it.next(); PackageDoc pkg = doc.containingPackage(); pkgSet.add(pkg); List<ProgramElementDoc> inPkg = map.get(pkg.name()); if (inPkg == null) { inPkg = new ArrayList<ProgramElementDoc>(); map.put(pkg.name(), inPkg); } inPkg.add(doc); } } return map; }
private <T extends ProgramElementDoc> void add(Map<String,List<T>> map, ClassDoc cd, T ref) { // add to specified map refList(map, cd).add(ref); // add ref's package to package map and class map packageSet(cd).add(ref.containingPackage()); classSet(cd).add(ref instanceof MemberDoc? ((MemberDoc)ref).containingClass() : (ClassDoc)ref); }
/** * Reconstitute the class name from the given class JavaDoc object. * * @param doc the Javadoc model for the given class. * @return The (string) class name of the given class. */ protected static String getClassName(ProgramElementDoc doc, boolean binaryName) { PackageDoc containingPackage = doc.containingPackage(); String className = doc.name(); if (binaryName) { className = className.replaceAll("\\.", "\\$"); } return containingPackage.name().length() > 0 ? String.format("%s.%s", containingPackage.name(), className) : String.format("%s", className); }
/** * Reconstitute the class name from the given class JavaDoc object. * * @param doc the Javadoc model for the given class. * @return The (string) class name of the given class. */ protected static String getClassName(ProgramElementDoc doc, boolean binaryName) { PackageDoc containingPackage = doc.containingPackage(); String className = doc.name(); if (binaryName) { className = className.replaceAll("\\.", "\\$"); } return containingPackage.name().length() > 0 ? String.format("%s.%s", containingPackage.name(), className) : String.format("%s", className); } }
private Map<String, List<ProgramElementDoc>> pkgDivide( Map<String, ? extends List<? extends ProgramElementDoc>> classMap ) { Map<String, List<ProgramElementDoc>> map = new HashMap<String, List<ProgramElementDoc>>(); List<? extends ProgramElementDoc> list = classMap.get( classdoc.qualifiedName() ); if( list != null ) { Collections.sort( list ); Iterator<? extends ProgramElementDoc> it = list.iterator(); while( it.hasNext() ) { ProgramElementDoc doc = it.next(); PackageDoc pkg = doc.containingPackage(); pkgSet.add( pkg ); List<ProgramElementDoc> inPkg = map.get( pkg.name() ); if( inPkg == null ) { inPkg = new ArrayList<ProgramElementDoc>(); map.put( pkg.name(), inPkg ); } inPkg.add( doc ); } } return map; }
private <T extends ProgramElementDoc> void add(Map<String,List<T>> map, ClassDoc cd, T ref) { // add to specified map refList(map, cd).add(ref); // add ref's package to package map and class map packageSet(cd).add(ref.containingPackage()); classSet(cd).add(ref instanceof MemberDoc? ((MemberDoc)ref).containingClass() : (ClassDoc)ref); }
/** * Return true if the given <code>ProgramElement</code> is inherited * by the class that is being documented. * * @param ped The <code>ProgramElement</code> being checked. * return true if the <code>ProgramElement</code> is being inherited and * false otherwise. */ protected boolean isInherited(ProgramElementDoc ped){ if(ped.isPrivate() || (ped.isPackagePrivate() && ! ped.containingPackage().equals(classdoc.containingPackage()))){ return false; } return true; }
/** * Return true if the given <code>ProgramElement</code> is inherited * by the class that is being documented. * * @param ped The <code>ProgramElement</code> being checked. * return true if the <code>ProgramElement</code> is being inherited and * false otherwise. */ protected boolean isInherited(ProgramElementDoc ped){ if(ped.isPrivate() || (ped.isPackagePrivate() && ! ped.containingPackage().equals(classdoc.containingPackage()))){ return false; } return true; }
/** * Should this doc element be added to the index map? */ protected boolean shouldAddToIndexMap(Doc element) { if (javafx) { if (element.tags("treatAsPrivate").length > 0) { return false; } } if (element instanceof PackageDoc) // Do not add to index map if -nodeprecated option is set and the // package is marked as deprecated. return !(noDeprecated && Util.isDeprecated(element)); else // Do not add to index map if -nodeprecated option is set and if the // Doc is marked as deprecated or the containing package is marked as // deprecated. return !(noDeprecated && (Util.isDeprecated(element) || Util.isDeprecated(((ProgramElementDoc)element).containingPackage()))); }
packageName = ((ProgramElementDoc)tag.holder()).containingPackage().name();
((ProgramElementDoc) holder()).containingPackage().name() + "." + where);