public boolean isIncluded() { return wrapped.isIncluded(); }
/** * Return true if this field is included in the active set. */ public boolean isIncluded() { return containingClass().isIncluded() && env.shouldDocument(sym); }
public boolean isClassLinkable( ClassDoc cd ) { if( cd.isIncluded() ) { return configuration.isGeneratedDoc( cd ); } return configuration.extern.isExternal( cd ); }
public boolean isClassLinkable(ClassDoc cd) { if (cd.isIncluded()) { return configuration.isGeneratedDoc(cd); } return configuration.extern.isExternal(cd); }
private static String getPath(PackageDoc pkg, ClassDoc node) { if (!node.isIncluded()) { return null; } String sourcePath = pkg.name().replace('.', '/'); String targetPath = node.containingPackage().name().replace('.', '/') + '/' + node.name() + ".html"; String[] sourcePathElements = sourcePath.split("[\\/\\\\]+"); String[] targetPathElements = targetPath.split("[\\/\\\\]+"); int maxCommonLength = Math.min(sourcePathElements.length, targetPathElements.length); int commonLength; for (commonLength = 0; commonLength < maxCommonLength; commonLength ++) { if (!sourcePathElements[commonLength].equals(targetPathElements[commonLength])) { break; } } StringBuilder buf = new StringBuilder(); for (int i = 0; i < sourcePathElements.length - commonLength; i ++) { buf.append("/.."); } for (int i = commonLength; i < targetPathElements.length; i ++) { buf.append('/'); buf.append(targetPathElements[i]); } return buf.substring(1); }
public boolean isIncluded() { return containingClass().isIncluded() && env.shouldDocument(sym); }
/** * Build the summary for the current class. * * @param elements the list of XML elements that make up the class * constant summary. */ public void buildClassConstantSummary(List<?> elements) { ClassDoc[] classes = currentPackage.name().length() > 0 ? currentPackage.allClasses() : configuration.classDocCatalog.allClasses( DocletConstants.DEFAULT_PACKAGE_NAME); Arrays.sort(classes); for (int i = 0; i < classes.length; i++) { if (! classDocsWithConstFields.contains(classes[i]) || ! classes[i].isIncluded()) { continue; } currentClass = classes[i]; //Build the documentation for the current class. build(elements); } }
/** * Return true if the given package has constant fields to document. * * @param pkg the package being checked. * @return true if the given package has constant fields to document. */ private boolean hasConstantField(PackageDoc pkg) { ClassDoc[] classes; if (pkg.name().length() > 0) { classes = pkg.allClasses(); } else { classes = configuration.classDocCatalog.allClasses( DocletConstants.DEFAULT_PACKAGE_NAME); } boolean found = false; for (int j = 0; j < classes.length; j++){ if (classes[j].isIncluded() && hasConstantField(classes[j])) { found = true; } } return found; }
/** * Return true if the given package has constant fields to document. * * @param pkg the package being checked. * @return true if the given package has constant fields to document. */ private boolean hasConstantField(PackageDoc pkg) { ClassDoc[] classes; if (pkg.name().length() > 0) { classes = pkg.allClasses(); } else { classes = configuration.classDocCatalog.allClasses( DocletConstants.DEFAULT_PACKAGE_NAME); } boolean found = false; for (int j = 0; j < classes.length; j++){ if (classes[j].isIncluded() && hasConstantField(classes[j])) { found = true; } } return found; }
/** * Build the summary for the current class. * * @param node the XML element that specifies which components to document * @param summariesTree the tree to which the class constant summary will be added */ public void buildClassConstantSummary(XMLNode node, Content summariesTree) { ClassDoc[] classes = currentPackage.name().length() > 0 ? currentPackage.allClasses() : configuration.classDocCatalog.allClasses( DocletConstants.DEFAULT_PACKAGE_NAME); Arrays.sort(classes); Content classConstantTree = writer.getClassConstantHeader(); for (int i = 0; i < classes.length; i++) { if (! classDocsWithConstFields.contains(classes[i]) || ! classes[i].isIncluded()) { continue; } currentClass = classes[i]; //Build the documentation for the current class. buildChildren(node, classConstantTree); } summariesTree.addContent(classConstantTree); }
/** * Return true if this class is linkable and false if we can't link to the * desired class. * <br> * <b>NOTE:</b> You can only link to external classes if they are public or * protected. * * @param classDoc the class to check. * @param configuration the current configuration of the doclet. * * @return true if this class is linkable and false if we can't link to the * desired class. */ public static boolean isLinkable(ClassDoc classDoc, Configuration configuration) { return ((classDoc.isIncluded() && configuration.isGeneratedDoc(classDoc))) || (configuration.extern.isExternal(classDoc) && (classDoc.isPublic() || classDoc.isProtected())); }
/** * Return true if this class is linkable and false if we can't link to the * desired class. * <br> * <b>NOTE:</b> You can only link to external classes if they are public or * protected. * * @param classDoc the class to check. * @param configuration the current configuration of the doclet. * * @return true if this class is linkable and false if we can't link to the * desired class. */ public static boolean isLinkable(ClassDoc classDoc, Configuration configuration) { return ((classDoc.isIncluded() && configuration.isGeneratedDoc(classDoc))) || (configuration.extern.isExternal(classDoc) && (classDoc.isPublic() || classDoc.isProtected())); }
/** * Return true if this class is included in the active set. * A ClassDoc is included iff either it is specified on the * commandline, or if it's containing package is specified * on the command line, or if it is a member class of an * included class. */ public boolean isIncluded() { if (isIncluded) { return true; } if (env.shouldDocument(tsym)) { // Class is nameable from top-level and // the class and all enclosing classes // pass the modifier filter. if (containingPackage().isIncluded()) { return isIncluded=true; } ClassDoc outer = containingClass(); if (outer != null && outer.isIncluded()) { return isIncluded=true; } } return false; }
protected Interface parseInterface(ClassDoc classDoc) { Interface interfaceNode = objectFactory.createInterface(); interfaceNode.setName(classDoc.name()); interfaceNode.setQualified(classDoc.qualifiedName()); String comment = classDoc.commentText(); if (comment.length() > 0) { interfaceNode.setComment(comment); } interfaceNode.setIncluded(classDoc.isIncluded()); interfaceNode.setScope(parseScope(classDoc)); for (TypeVariable typeVariable : classDoc.typeParameters()) { interfaceNode.getGeneric().add(parseTypeParameter(typeVariable)); } for (Type interfaceType : classDoc.interfaceTypes()) { interfaceNode.getInterface().add(parseTypeInfo(interfaceType)); } for (MethodDoc method : classDoc.methods()) { interfaceNode.getMethod().add(parseMethod(method)); } for (AnnotationDesc annotationDesc : classDoc.annotations()) { interfaceNode.getAnnotation().add(parseAnnotationDesc(annotationDesc, classDoc.qualifiedName())); } for (Tag tag : classDoc.tags()) { interfaceNode.getTag().add(parseTag(tag)); } for (FieldDoc field : classDoc.fields()) { interfaceNode.getField().add(parseField(field)); } return interfaceNode; }
protected Enum parseEnum(ClassDoc classDoc) { Enum enumNode = objectFactory.createEnum(); enumNode.setName(classDoc.name()); enumNode.setQualified(classDoc.qualifiedName()); String comment = classDoc.commentText(); if (comment.length() > 0) { enumNode.setComment(comment); } enumNode.setIncluded(classDoc.isIncluded()); enumNode.setScope(parseScope(classDoc)); Type superClassType = classDoc.superclassType(); if (superClassType != null) { enumNode.setClazz(parseTypeInfo(superClassType)); } for (Type interfaceType : classDoc.interfaceTypes()) { enumNode.getInterface().add(parseTypeInfo(interfaceType)); } for (FieldDoc field : classDoc.enumConstants()) { enumNode.getConstant().add(parseEnumConstant(field)); } for (AnnotationDesc annotationDesc : classDoc.annotations()) { enumNode.getAnnotation().add(parseAnnotationDesc(annotationDesc, classDoc.qualifiedName())); } for (Tag tag : classDoc.tags()) { enumNode.getTag().add(parseTag(tag)); } return enumNode; }
/** * {@inheritDoc} */ public void addComments(FieldDoc field, Content fieldDocTree) { ClassDoc holder = field.containingClass(); if (field.inlineTags().length > 0) { if (holder.equals(classdoc) || (! (holder.isPublic() || Util.isLinkable(holder, configuration)))) { writer.addInlineComment(field, fieldDocTree); } else { Content link = writer.getDocLink(LinkInfoImpl.Kind.FIELD_DOC_COPY, holder, field, holder.isIncluded() ? holder.typeName() : holder.qualifiedTypeName(), false); Content codeLink = HtmlTree.CODE(link); Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.isClass()? writer.descfrmClassLabel : writer.descfrmInterfaceLabel); descfrmLabel.addContent(writer.getSpace()); descfrmLabel.addContent(codeLink); fieldDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel)); writer.addInlineComment(field, fieldDocTree); } } }
/** * {@inheritDoc} */ public void addComments(MethodDoc property, Content propertyDocTree) { ClassDoc holder = property.containingClass(); if (property.inlineTags().length > 0) { if (holder.equals(classdoc) || (! (holder.isPublic() || Util.isLinkable(holder, configuration)))) { writer.addInlineComment(property, propertyDocTree); } else { Content link = writer.getDocLink(LinkInfoImpl.Kind.PROPERTY_DOC_COPY, holder, property, holder.isIncluded() ? holder.typeName() : holder.qualifiedTypeName(), false); Content codeLink = HtmlTree.CODE(link); Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.isClass()? writer.descfrmClassLabel : writer.descfrmInterfaceLabel); descfrmLabel.addContent(writer.getSpace()); descfrmLabel.addContent(codeLink); propertyDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel)); writer.addInlineComment(property, propertyDocTree); } } }
/** * {@inheritDoc} */ public void addComments(Type holder, MethodDoc method, Content methodDocTree) { ClassDoc holderClassDoc = holder.asClassDoc(); if (method.inlineTags().length > 0) { if (holder.asClassDoc().equals(classdoc) || (! (holderClassDoc.isPublic() || Util.isLinkable(holderClassDoc, configuration)))) { writer.addInlineComment(method, methodDocTree); } else { Content link = writer.getDocLink(LinkInfoImpl.Kind.METHOD_DOC_COPY, holder.asClassDoc(), method, holder.asClassDoc().isIncluded() ? holder.typeName() : holder.qualifiedTypeName(), false); Content codelLink = HtmlTree.CODE(link); Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.asClassDoc().isClass()? writer.descfrmClassLabel : writer.descfrmInterfaceLabel); descfrmLabel.addContent(writer.getSpace()); descfrmLabel.addContent(codelLink); methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel)); writer.addInlineComment(method, methodDocTree); } } }
writer.getDocLink(LinkInfoImpl.CONTEXT_FIELD_DOC_COPY, holder, field, holder.isIncluded() ? holder.typeName() : holder.qualifiedTypeName(), false));
writer.getDocLink( LinkInfoImpl.CONTEXT_METHOD_DOC_COPY, holder.asClassDoc(), method, holder.asClassDoc().isIncluded() ? holder.typeName() : holder.qualifiedTypeName(), false ) ); writer.dd();