langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java
changeset 5855 00d9c252e60c
parent 5520 86e4b9a9da40
child 7614 cfadc977ca75
equal deleted inserted replaced
5854:5dc61238219e 5855:00d9c252e60c
    28 
    28 
    29 import com.sun.tools.doclets.internal.toolkit.util.*;
    29 import com.sun.tools.doclets.internal.toolkit.util.*;
    30 import com.sun.tools.doclets.internal.toolkit.*;
    30 import com.sun.tools.doclets.internal.toolkit.*;
    31 import com.sun.javadoc.*;
    31 import com.sun.javadoc.*;
    32 import java.util.*;
    32 import java.util.*;
    33 import java.lang.reflect.*;
       
    34 
    33 
    35 /**
    34 /**
    36  * Builds documentation for required annotation type members.
    35  * Builds documentation for required annotation type members.
    37  *
    36  *
    38  * This code is not part of an API.
    37  * This code is not part of an API.
   112     public String getName() {
   111     public String getName() {
   113         return "AnnotationTypeRequiredMemberDetails";
   112         return "AnnotationTypeRequiredMemberDetails";
   114     }
   113     }
   115 
   114 
   116     /**
   115     /**
   117      * {@inheritDoc}
       
   118      */
       
   119     public void invokeMethod(String methodName, Class<?>[] paramClasses,
       
   120             Object[] params)
       
   121     throws Exception {
       
   122         if (DEBUG) {
       
   123             configuration.root.printError("DEBUG: " + this.getClass().getName()
       
   124                 + "." + methodName);
       
   125         }
       
   126         Method method = this.getClass().getMethod(methodName, paramClasses);
       
   127         method.invoke(this, params);
       
   128     }
       
   129 
       
   130     /**
       
   131      * Returns a list of members that will be documented for the given class.
   116      * Returns a list of members that will be documented for the given class.
   132      * This information can be used for doclet specific documentation
   117      * This information can be used for doclet specific documentation
   133      * generation.
   118      * generation.
   134      *
   119      *
   135      * @param classDoc the {@link ClassDoc} we want to check.
   120      * @param classDoc the {@link ClassDoc} we want to check.
   159      * Build the member documentation.
   144      * Build the member documentation.
   160      *
   145      *
   161      * @param elements the XML elements that specify how to construct this
   146      * @param elements the XML elements that specify how to construct this
   162      *                documentation.
   147      *                documentation.
   163      */
   148      */
   164     public void buildAnnotationTypeRequiredMember(List<?> elements) {
   149     public void buildAnnotationTypeRequiredMember(XMLNode node) {
   165         if (writer == null) {
   150         if (writer == null) {
   166             return;
   151             return;
   167         }
   152         }
   168         for (currentMemberIndex = 0; currentMemberIndex < members.size();
   153         for (currentMemberIndex = 0; currentMemberIndex < members.size();
   169             currentMemberIndex++) {
   154             currentMemberIndex++) {
   170             build(elements);
   155             buildChildren(node);
   171         }
   156         }
   172     }
   157     }
   173 
   158 
   174     /**
   159     /**
   175      * Build the overall header.
   160      * Build the overall header.
   176      */
   161      */
   177     public void buildHeader() {
   162     public void buildHeader(XMLNode node) {
   178         writer.writeHeader(classDoc,
   163         writer.writeHeader(classDoc,
   179             configuration.getText("doclet.Annotation_Type_Member_Detail"));
   164             configuration.getText("doclet.Annotation_Type_Member_Detail"));
   180     }
   165     }
   181 
   166 
   182     /**
   167     /**
   183      * Build the header for the individual members.
   168      * Build the header for the individual members.
   184      */
   169      */
   185     public void buildMemberHeader() {
   170     public void buildMemberHeader(XMLNode node) {
   186         writer.writeMemberHeader((MemberDoc) members.get(
   171         writer.writeMemberHeader((MemberDoc) members.get(
   187                 currentMemberIndex),
   172                 currentMemberIndex),
   188             currentMemberIndex == 0);
   173             currentMemberIndex == 0);
   189     }
   174     }
   190 
   175 
   191     /**
   176     /**
   192      * Build the signature.
   177      * Build the signature.
   193      */
   178      */
   194     public void buildSignature() {
   179     public void buildSignature(XMLNode node) {
   195         writer.writeSignature((MemberDoc) members.get(currentMemberIndex));
   180         writer.writeSignature((MemberDoc) members.get(currentMemberIndex));
   196     }
   181     }
   197 
   182 
   198     /**
   183     /**
   199      * Build the deprecation information.
   184      * Build the deprecation information.
   200      */
   185      */
   201     public void buildDeprecationInfo() {
   186     public void buildDeprecationInfo(XMLNode node) {
   202         writer.writeDeprecated((MemberDoc) members.get(currentMemberIndex));
   187         writer.writeDeprecated((MemberDoc) members.get(currentMemberIndex));
   203     }
   188     }
   204 
   189 
   205     /**
   190     /**
   206      * Build the comments for the member.  Do nothing if
   191      * Build the comments for the member.  Do nothing if
   207      * {@link Configuration#nocomment} is set to true.
   192      * {@link Configuration#nocomment} is set to true.
   208      */
   193      */
   209     public void buildMemberComments() {
   194     public void buildMemberComments(XMLNode node) {
   210         if(! configuration.nocomment){
   195         if(! configuration.nocomment){
   211             writer.writeComments((MemberDoc) members.get(currentMemberIndex));
   196             writer.writeComments((MemberDoc) members.get(currentMemberIndex));
   212         }
   197         }
   213     }
   198     }
   214 
   199 
   215     /**
   200     /**
   216      * Build the tag information.
   201      * Build the tag information.
   217      */
   202      */
   218     public void buildTagInfo() {
   203     public void buildTagInfo(XMLNode node) {
   219         writer.writeTags((MemberDoc) members.get(currentMemberIndex));
   204         writer.writeTags((MemberDoc) members.get(currentMemberIndex));
   220     }
   205     }
   221 
   206 
   222     /**
   207     /**
   223      * Build the footer for the individual member.
   208      * Build the footer for the individual member.
   224      */
   209      */
   225     public void buildMemberFooter() {
   210     public void buildMemberFooter(XMLNode node) {
   226         writer.writeMemberFooter();
   211         writer.writeMemberFooter();
   227     }
   212     }
   228 
   213 
   229     /**
   214     /**
   230      * Build the overall footer.
   215      * Build the overall footer.
   231      */
   216      */
   232     public void buildFooter() {
   217     public void buildFooter(XMLNode node) {
   233         writer.writeFooter(classDoc);
   218         writer.writeFooter(classDoc);
   234     }
   219     }
   235 
   220 
   236     /**
   221     /**
   237      * Return the annotation type required member writer for this builder.
   222      * Return the annotation type required member writer for this builder.