53 54 /** 55 * Construct a new AnnotationTypeFieldWriterImpl. 56 * 57 * @param writer the writer that will write the output. 58 * @param annotationType the AnnotationType that holds this member. 59 */ 60 public AnnotationTypeFieldWriterImpl(SubWriterHolderWriter writer, 61 TypeElement annotationType) { 62 super(writer, annotationType); 63 } 64 65 /** 66 * {@inheritDoc} 67 */ 68 public Content getMemberSummaryHeader(TypeElement typeElement, 69 Content memberSummaryTree) { 70 memberSummaryTree.add( 71 MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY); 72 Content memberTree = new ContentBuilder(); 73 writer.addSummaryHeader(this, typeElement, memberTree); 74 return memberTree; 75 } 76 77 /** 78 * {@inheritDoc} 79 */ 80 public Content getMemberTreeHeader() { 81 return writer.getMemberTreeHeader(); 82 } 83 84 /** 85 * {@inheritDoc} 86 */ 87 public void addMemberTree(Content memberSummaryTree, Content memberTree) { 88 writer.addMemberTree(HtmlStyle.fieldSummary, memberSummaryTree, memberTree); 89 } 90 91 /** 92 * {@inheritDoc} 93 */ 94 public void addAnnotationFieldDetailsMarker(Content memberDetails) { 95 memberDetails.add(MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_DETAILS); 96 } 97 98 /** 99 * {@inheritDoc} 100 */ 101 public Content getAnnotationDetailsTreeHeader(TypeElement typeElement) { 102 Content memberDetailsTree = new ContentBuilder(); 103 if (!writer.printedAnnotationFieldHeading) { 104 Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, 105 contents.fieldDetailsLabel); 106 memberDetailsTree.add(links.createAnchor( 107 SectionName.ANNOTATION_TYPE_FIELD_DETAIL)); 108 memberDetailsTree.add(heading); 109 writer.printedAnnotationFieldHeading = true; 110 } 111 return memberDetailsTree; 112 } 113 114 /** 115 * {@inheritDoc} 116 */ 117 public Content getAnnotationDocTreeHeader(Element member, 118 Content annotationDetailsTree) { 119 Content annotationDocTree = new ContentBuilder(); 120 Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING); 121 heading.add(links.createAnchor(name(member), new StringContent(name(member)))); 122 annotationDocTree.add(heading); 123 return HtmlTree.SECTION(HtmlStyle.detail, annotationDocTree); 124 } 125 126 /** 127 * {@inheritDoc} 128 */ 129 public Content getSignature(Element member) { 130 return new MemberSignature(member) 131 .addType(getType(member)) 132 .toContent(); 133 } 134 135 /** 136 * {@inheritDoc} 137 */ 138 public void addDeprecated(Element member, Content annotationDocTree) { 139 addDeprecatedInfo(member, annotationDocTree); 140 } 141 142 /** 143 * {@inheritDoc} 144 */ 145 public void addComments(Element member, Content annotationDocTree) { 146 addComment(member, annotationDocTree); 147 } 148 149 /** 150 * {@inheritDoc} 151 */ 152 public void addTags(Element member, Content annotationDocTree) { 153 writer.addTagsInfo(member, annotationDocTree); 154 } 155 156 /** 157 * {@inheritDoc} 158 */ 159 public Content getAnnotationDetails(Content annotationDetailsTreeHeader, Content annotationDetailsTree) { 160 Content annotationDetails = new ContentBuilder(); 161 annotationDetails.add(annotationDetailsTreeHeader); 162 annotationDetails.add(annotationDetailsTree); 163 return getMemberTree(HtmlTree.SECTION(HtmlStyle.fieldDetails, annotationDetails)); 164 } 165 166 /** 167 * {@inheritDoc} 168 */ 169 public Content getAnnotationDoc(Content annotationDocTree) { 170 return getMemberTree(annotationDocTree); 171 } 172 173 /** 174 * {@inheritDoc} 175 */ 176 public void addSummaryLabel(Content memberTree) { 177 Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, 178 contents.fieldSummaryLabel); 179 memberTree.add(label); 180 } 181 182 /** 183 * {@inheritDoc} 184 */ 185 @Override 186 public TableHeader getSummaryTableHeader(Element member) { 187 return new TableHeader(contents.modifierAndTypeLabel, contents.fields, 188 contents.descriptionLabel); 189 } 190 191 @Override 192 protected Table createSummaryTable() { 193 Content caption = contents.getContent("doclet.Fields"); 194 195 TableHeader header = new TableHeader(contents.modifierAndTypeLabel, contents.fields, 196 contents.descriptionLabel); 197 198 return new Table(HtmlStyle.memberSummary) 199 .setCaption(caption) 200 .setHeader(header) 201 .setRowScopeColumn(1) 202 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast); 203 } 204 205 /** 206 * {@inheritDoc} 207 */ 208 @Override 209 public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { 210 memberTree.add(links.createAnchor( 211 SectionName.ANNOTATION_TYPE_FIELD_SUMMARY)); 212 } 213 214 /** 215 * {@inheritDoc} 216 */ 217 @Override 218 public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) { 219 } 220 221 /** 222 * {@inheritDoc} 223 */ 224 @Override 225 public void addInheritedSummaryLabel(TypeElement typeElement, Content inheritedTree) { 226 } 227 228 /** 229 * {@inheritDoc} 230 */ 231 @Override 232 protected void addSummaryLink(LinkInfoImpl.Kind context, TypeElement typeElement, Element member, 233 Content tdSummary) { 234 Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, 235 writer.getDocLink(context, member, name(member), false)); 236 Content code = HtmlTree.CODE(memberLink); 237 tdSummary.add(code); 238 } 239 240 /** 241 * {@inheritDoc} 242 */ 243 protected void addInheritedSummaryLink(TypeElement typeElement, 244 Element member, Content linksTree) { | 53 54 /** 55 * Construct a new AnnotationTypeFieldWriterImpl. 56 * 57 * @param writer the writer that will write the output. 58 * @param annotationType the AnnotationType that holds this member. 59 */ 60 public AnnotationTypeFieldWriterImpl(SubWriterHolderWriter writer, 61 TypeElement annotationType) { 62 super(writer, annotationType); 63 } 64 65 /** 66 * {@inheritDoc} 67 */ 68 public Content getMemberSummaryHeader(TypeElement typeElement, 69 Content memberSummaryTree) { 70 memberSummaryTree.add( 71 MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY); 72 Content memberTree = new ContentBuilder(); 73 writer.addSummaryHeader(this, memberTree); 74 return memberTree; 75 } 76 77 /** 78 * {@inheritDoc} 79 */ 80 public Content getMemberTreeHeader() { 81 return writer.getMemberTreeHeader(); 82 } 83 84 /** 85 * {@inheritDoc} 86 */ 87 public void addMemberTree(Content memberSummaryTree, Content memberTree) { 88 writer.addMemberTree(HtmlStyle.fieldSummary, 89 SectionName.ANNOTATION_TYPE_FIELD_SUMMARY, memberSummaryTree, memberTree); 90 } 91 92 /** 93 * {@inheritDoc} 94 */ 95 public void addAnnotationFieldDetailsMarker(Content memberDetails) { 96 memberDetails.add(MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_DETAILS); 97 } 98 99 /** 100 * {@inheritDoc} 101 */ 102 public Content getAnnotationDetailsTreeHeader() { 103 Content memberDetailsTree = new ContentBuilder(); 104 if (!writer.printedAnnotationFieldHeading) { 105 Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, 106 contents.fieldDetailsLabel); 107 memberDetailsTree.add(heading); 108 writer.printedAnnotationFieldHeading = true; 109 } 110 return memberDetailsTree; 111 } 112 113 /** 114 * {@inheritDoc} 115 */ 116 public Content getAnnotationDocTreeHeader(Element member) { 117 Content annotationDocTree = new ContentBuilder(); 118 Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING, 119 new StringContent(name(member))); 120 annotationDocTree.add(heading); 121 return HtmlTree.SECTION(HtmlStyle.detail, annotationDocTree).setId(name(member)); 122 } 123 124 /** 125 * {@inheritDoc} 126 */ 127 public Content getSignature(Element member) { 128 return new MemberSignature(member) 129 .addType(getType(member)) 130 .toContent(); 131 } 132 133 /** 134 * {@inheritDoc} 135 */ 136 public void addDeprecated(Element member, Content annotationDocTree) { 137 addDeprecatedInfo(member, annotationDocTree); 138 } 139 140 /** 141 * {@inheritDoc} 142 */ 143 public void addComments(Element member, Content annotationDocTree) { 144 addComment(member, annotationDocTree); 145 } 146 147 /** 148 * {@inheritDoc} 149 */ 150 public void addTags(Element member, Content annotationDocTree) { 151 writer.addTagsInfo(member, annotationDocTree); 152 } 153 154 /** 155 * {@inheritDoc} 156 */ 157 public Content getAnnotationDetails(Content annotationDetailsTreeHeader, Content annotationDetailsTree) { 158 Content annotationDetails = new ContentBuilder(); 159 annotationDetails.add(annotationDetailsTreeHeader); 160 annotationDetails.add(annotationDetailsTree); 161 return getMemberTree(HtmlTree.SECTION(HtmlStyle.fieldDetails, annotationDetails) 162 .setId(SectionName.ANNOTATION_TYPE_FIELD_DETAIL.getName())); 163 } 164 165 /** 166 * {@inheritDoc} 167 */ 168 public Content getAnnotationDoc(Content annotationDocTree) { 169 return getMemberTree(annotationDocTree); 170 } 171 172 /** 173 * {@inheritDoc} 174 */ 175 public void addSummaryLabel(Content memberTree) { 176 HtmlTree label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, 177 contents.fieldSummaryLabel); 178 memberTree.add(label); 179 } 180 181 /** 182 * {@inheritDoc} 183 */ 184 @Override 185 public TableHeader getSummaryTableHeader(Element member) { 186 return new TableHeader(contents.modifierAndTypeLabel, contents.fields, 187 contents.descriptionLabel); 188 } 189 190 @Override 191 protected Table createSummaryTable() { 192 Content caption = contents.getContent("doclet.Fields"); 193 194 TableHeader header = new TableHeader(contents.modifierAndTypeLabel, contents.fields, 195 contents.descriptionLabel); 196 197 return new Table(HtmlStyle.memberSummary) 198 .setCaption(caption) 199 .setHeader(header) 200 .setRowScopeColumn(1) 201 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast); 202 } 203 204 /** 205 * {@inheritDoc} 206 */ 207 @Override 208 public void addInheritedSummaryLabel(TypeElement typeElement, Content inheritedTree) { 209 } 210 211 /** 212 * {@inheritDoc} 213 */ 214 @Override 215 protected void addSummaryLink(LinkInfoImpl.Kind context, TypeElement typeElement, Element member, 216 Content tdSummary) { 217 Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, 218 writer.getDocLink(context, member, name(member), false)); 219 Content code = HtmlTree.CODE(memberLink); 220 tdSummary.add(code); 221 } 222 223 /** 224 * {@inheritDoc} 225 */ 226 protected void addInheritedSummaryLink(TypeElement typeElement, 227 Element member, Content linksTree) { |