langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.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 optional annotation type members.
    35  * Builds documentation for optional annotation type members.
    37  *
    36  *
    38  * This code is not part of an API.
    37  * This code is not part of an API.
    83     }
    82     }
    84 
    83 
    85     /**
    84     /**
    86      * {@inheritDoc}
    85      * {@inheritDoc}
    87      */
    86      */
       
    87     @Override
    88     public String getName() {
    88     public String getName() {
    89         return "AnnotationTypeOptionalMemberDetails";
    89         return "AnnotationTypeOptionalMemberDetails";
    90     }
    90     }
    91 
    91 
    92     /**
    92     /**
    93      * Build the member documentation.
    93      * Build the member documentation.
    94      *
    94      *
    95      * @param elements the XML elements that specify how to construct this
    95      * @param elements the XML elements that specify how to construct this
    96      *                documentation.
    96      *                documentation.
    97      */
    97      */
    98     public void buildAnnotationTypeOptionalMember(List<?> elements) {
    98     public void buildAnnotationTypeOptionalMember(XMLNode node) {
    99         if (writer == null) {
    99         if (writer == null) {
   100             return;
   100             return;
   101         }
   101         }
   102         for (currentMemberIndex = 0; currentMemberIndex < members.size();
   102         for (currentMemberIndex = 0; currentMemberIndex < members.size();
   103             currentMemberIndex++) {
   103             currentMemberIndex++) {
   104             build(elements);
   104             buildChildren(node);
   105         }
   105         }
   106     }
       
   107 
       
   108     /**
       
   109      * {@inheritDoc}
       
   110      */
       
   111     public void invokeMethod(String methodName, Class<?>[] paramClasses,
       
   112             Object[] params)
       
   113     throws Exception {
       
   114         if (DEBUG) {
       
   115             configuration.root.printError("DEBUG: " + this.getClass().getName()
       
   116                 + "." + methodName);
       
   117         }
       
   118         Method method = this.getClass().getMethod(methodName, paramClasses);
       
   119         method.invoke(this, params);
       
   120     }
   106     }
   121 
   107 
   122     /**
   108     /**
   123      * Document the default value for this optional member.
   109      * Document the default value for this optional member.
   124      */
   110      */
   125     public void buildDefaultValueInfo() {
   111     public void buildDefaultValueInfo(XMLNode node) {
   126         ((AnnotationTypeOptionalMemberWriter) writer).writeDefaultValueInfo(
   112         ((AnnotationTypeOptionalMemberWriter) writer).writeDefaultValueInfo(
   127             (MemberDoc) members.get(currentMemberIndex));
   113             (MemberDoc) members.get(currentMemberIndex));
   128     }
   114     }
   129 
   115 
   130     /**
   116     /**
   131      * {@inheritDoc}
   117      * {@inheritDoc}
   132      */
   118      */
       
   119     @Override
   133     public AnnotationTypeRequiredMemberWriter getWriter() {
   120     public AnnotationTypeRequiredMemberWriter getWriter() {
   134         return writer;
   121         return writer;
   135     }
   122     }
   136 }
   123 }