public void writeClassAnnotiations(ClassDoc classDoc, StringBuilder sb) { AnnotationDesc[] annotations = classDoc.annotations(); for (AnnotationDesc annotation : annotations) { sb.append("\t").append(annotation.annotationType().name()).append(" : \n"); writeAnnotationTable(annotation, sb); } }
public void writeFieldAnnotiations(FieldDoc fieldDoc, StringBuilder sb) { AnnotationDesc[] annotations = fieldDoc.annotations(); for (AnnotationDesc annotation : annotations) { String fieldName = fieldDoc.name(); sb.append("\t").append(annotation.annotationType().name()).append(String.format(" [%s]", fieldName)); sb.append(" : \n"); writeAnnotationTable(annotation, sb); } }
/** * Build the header of the page. */ public void buildAnnotationTypeHeader() { writer.writeHeader( configuration.getText( "doclet.AnnotationType" ) + " " + annotationTypeDoc.name() ); }
ContentBuilder annotation, AnnotationDesc.ElementValuePair[] pairs, int indent, boolean linkBreak) { linkInfo.label = new StringContent("@" + annotationDoc.name()); annotation.addContent(getLink(linkInfo)); if (pairs.length > 0) { if (linkBreak) { annotation.addContent(DocletConstants.NL); int spaces = annotationDoc.name().length() + 2; for (int k = 0; k < (spaces + indent); k++) { annotation.addContent(" ");
/** * @param annotationType the annotation type being documented. * @param prevType the previous class that was documented. * @param nextType the next class being documented. */ public AnnotationTypeWriterImpl( AnnotationTypeDoc annotationType, Type prevType, Type nextType ) throws Exception { super( ConfigurationImpl.getInstance(), DirectoryManager.getDirectoryPath( annotationType.containingPackage() ), annotationType.name() + ".html", DirectoryManager.getRelativePath( annotationType.containingPackage().name() ) ); this.annotationType = annotationType; configuration.currentcd = annotationType.asClassDoc(); this.prev = prevType; this.next = nextType; }
trace.trace(classDoc.name() + " > " + methodDoc.qualifiedName() + " > " + annotationDesc.annotationType().name()); trace.trace(asList(annotationDesc.elementValues()).toString()); trace.trace(methodDoc.commentText()); .setHttpMethod(annotationDesc.annotationType().name()) .setPath(String.valueOf(value.get())) .setNotes(methodDoc.commentText());
annotationInstanceNode.setName(annotTypeInfo.name()); annotationInstanceNode.setQualified(annotTypeInfo.qualifiedTypeName()); } catch (ClassCastException castException) {
/** * Parse an annotation. * * @param annotationTypeDoc * A AnnotationTypeDoc instance * @return the annotation node */ protected Annotation parseAnnotationTypeDoc(AnnotationTypeDoc annotationTypeDoc) { Annotation annotationNode = objectFactory.createAnnotation(); annotationNode.setName(annotationTypeDoc.name()); annotationNode.setQualified(annotationTypeDoc.qualifiedName()); String comment = annotationTypeDoc.commentText(); if (comment.length() > 0) { annotationNode.setComment(comment); } annotationNode.setIncluded(annotationTypeDoc.isIncluded()); annotationNode.setScope(parseScope(annotationTypeDoc)); for (AnnotationTypeElementDoc annotationTypeElementDoc : annotationTypeDoc.elements()) { annotationNode.getElement().add(parseAnnotationTypeElementDoc(annotationTypeElementDoc)); } for (AnnotationDesc annotationDesc : annotationTypeDoc.annotations()) { annotationNode.getAnnotation().add(parseAnnotationDesc(annotationDesc, annotationTypeDoc.qualifiedName())); } for (Tag tag : annotationTypeDoc.tags()) { annotationNode.getTag().add(parseTag(tag)); } return annotationNode; }
/** * Build the annotation type documentation. * * @param node the XML element that specifies which components to document * @param contentTree the content tree to which the documentation will be added */ public void buildAnnotationTypeDoc(XMLNode node, Content contentTree) throws Exception { contentTree = writer.getHeader(configuration.getText("doclet.AnnotationType") + " " + annotationTypeDoc.name()); Content annotationContentTree = writer.getAnnotationContentHeader(); buildChildren(node, annotationContentTree); contentTree.addContent(annotationContentTree); writer.addFooter(contentTree); writer.printDocument(contentTree); writer.close(); copyDocFiles(); }
/** * {@inheritDoc} */ public void writeAnnotationTypeSignature( String modifiers ) { preNoNewLine(); writeAnnotationInfo( annotationType ); print( modifiers ); String name = annotationType.name() + getTypeParameterLinks( new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false ) ); if( configuration().linksource ) { printSrcLink( annotationType, name ); } else { strong( name ); } preEnd(); p(); }
/** * {@inheritDoc} */ public void writeHeader( String header ) { String pkgname = (annotationType.containingPackage() != null) ? annotationType.containingPackage().name() : ""; String clname = annotationType.name(); printHtmlHeader( clname, configuration.metakeywords.getMetaKeywords( annotationType ), true ); printTop(); navLinks( true ); println( "<!-- ======== START OF CLASS DATA ======== -->" ); if( pkgname.length() > 0 ) { font( "-1" ); print( pkgname ); fontEnd(); br(); } print( header + getTypeParameterLinks( new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER, annotationType, false ) ) ); h2End(); }
/** * {@inheritDoc} */ public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree) { annotationInfoTree.addContent(new HtmlTree(HtmlTag.BR)); Content pre = new HtmlTree(HtmlTag.PRE); addAnnotationInfo(annotationType, pre); pre.addContent(modifiers); LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_SIGNATURE, annotationType); Content annotationName = new StringContent(annotationType.name()); Content parameterLinks = getTypeParameterLinks(linkInfo); if (configuration.linksource) { addSrcLink(annotationType, annotationName, pre); pre.addContent(parameterLinks); } else { Content span = HtmlTree.SPAN(HtmlStyle.memberNameLabel, annotationName); span.addContent(parameterLinks); pre.addContent(span); } annotationInfoTree.addContent(pre); }
/** * {@inheritDoc} */ public Content getHeader(String header) { String pkgname = (annotationType.containingPackage() != null)? annotationType.containingPackage().name(): ""; String clname = annotationType.name(); Content bodyTree = getBody(true, getWindowTitle(clname)); addTop(bodyTree); addNavLinks(true, bodyTree); bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA); HtmlTree div = new HtmlTree(HtmlTag.DIV); div.addStyle(HtmlStyle.header); if (pkgname.length() > 0) { Content pkgNameContent = new StringContent(pkgname); Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent); div.addContent(pkgNameDiv); } LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_HEADER, annotationType); Content headerContent = new StringContent(header); Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true, HtmlStyle.title, headerContent); heading.addContent(getTypeParameterLinks(linkInfo)); div.addContent(heading); bodyTree.addContent(div); return bodyTree; }