< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java

Print this page




 394         if (!isGetter && !isSetter) {
 395             ExecutableElement getter = pHelper.getGetterForProperty((ExecutableElement)member);
 396             ExecutableElement setter = pHelper.getSetterForProperty((ExecutableElement)member);
 397 
 398             if (null != getter) {
 399                 StringBuilder sb = new StringBuilder("#");
 400                 sb.append(utils.getSimpleName(getter)).append("()");
 401                 blockTags.add(cmtutils.makeSeeTree(sb.toString(), getter));
 402             }
 403 
 404             if (null != setter) {
 405                 VariableElement param = setter.getParameters().get(0);
 406                 StringBuilder sb = new StringBuilder("#");
 407                 sb.append(utils.getSimpleName(setter));
 408                 if (!utils.isTypeVariable(param.asType())) {
 409                     sb.append("(").append(utils.getTypeSignature(param.asType(), false, true)).append(")");
 410                 }
 411                 blockTags.add(cmtutils.makeSeeTree(sb.toString(), setter));
 412             }
 413         }
 414         cmtutils.setDocCommentTree(member, fullBody, blockTags, utils);
 415     }
 416 
 417     /**
 418      * Test whether the method is a getter.
 419      * @param element property method documentation. Needs to be either property
 420      * method, property getter, or property setter.
 421      * @return true if the given documentation belongs to a getter.
 422      */
 423     private boolean isGetter(Element element) {
 424         final String pedName = element.getSimpleName().toString();
 425         return pedName.startsWith("get") || pedName.startsWith("is");
 426     }
 427 
 428     /**
 429      * Test whether the method is a setter.
 430      * @param element property method documentation. Needs to be either property
 431      * method, property getter, or property setter.
 432      * @return true if the given documentation belongs to a setter.
 433      */
 434     private boolean isSetter(Element element) {




 394         if (!isGetter && !isSetter) {
 395             ExecutableElement getter = pHelper.getGetterForProperty((ExecutableElement)member);
 396             ExecutableElement setter = pHelper.getSetterForProperty((ExecutableElement)member);
 397 
 398             if (null != getter) {
 399                 StringBuilder sb = new StringBuilder("#");
 400                 sb.append(utils.getSimpleName(getter)).append("()");
 401                 blockTags.add(cmtutils.makeSeeTree(sb.toString(), getter));
 402             }
 403 
 404             if (null != setter) {
 405                 VariableElement param = setter.getParameters().get(0);
 406                 StringBuilder sb = new StringBuilder("#");
 407                 sb.append(utils.getSimpleName(setter));
 408                 if (!utils.isTypeVariable(param.asType())) {
 409                     sb.append("(").append(utils.getTypeSignature(param.asType(), false, true)).append(")");
 410                 }
 411                 blockTags.add(cmtutils.makeSeeTree(sb.toString(), setter));
 412             }
 413         }
 414         cmtutils.setDocCommentTree(member, fullBody, blockTags);
 415     }
 416 
 417     /**
 418      * Test whether the method is a getter.
 419      * @param element property method documentation. Needs to be either property
 420      * method, property getter, or property setter.
 421      * @return true if the given documentation belongs to a getter.
 422      */
 423     private boolean isGetter(Element element) {
 424         final String pedName = element.getSimpleName().toString();
 425         return pedName.startsWith("get") || pedName.startsWith("is");
 426     }
 427 
 428     /**
 429      * Test whether the method is a setter.
 430      * @param element property method documentation. Needs to be either property
 431      * method, property getter, or property setter.
 432      * @return true if the given documentation belongs to a setter.
 433      */
 434     private boolean isSetter(Element element) {


< prev index next >