protected void collectParamComments(Function f) { for (Arg arg : f.getArgs()) { arg.moveAllCommentsBefore(); TypeRef argType = arg.getValueType(); if (argType != null) { if (!result.config.noComments) { argType.moveAllCommentsBefore(); arg.addToCommentBefore(argType.getCommentBefore()); } argType.stripDetails(); } if (arg.getCommentBefore() != null) { if (!result.config.noComments) { f.addToCommentBefore("@param " + arg.getName() + " " + Element.cleanComment(arg.getCommentBefore())); } arg.stripDetails(); } } }
protected void collectParamComments(Function f) { for (Arg arg : f.getArgs()) { arg.moveAllCommentsBefore(); TypeRef argType = arg.getValueType(); if (argType != null) { if (!result.config.noComments) { argType.moveAllCommentsBefore(); arg.addToCommentBefore(argType.getCommentBefore()); } argType.stripDetails(); } if (arg.getCommentBefore() != null) { if (!result.config.noComments) { f.addToCommentBefore("@param " + arg.getName() + " " + Element.cleanComment(arg.getCommentBefore())); } arg.stripDetails(); } } }
@Override public void visitArg(Arg arg) { super.visitArg(arg); if (arg.getName() == null) { return; } if (!result.config.features.contains(GenFeatures.FunctionArgsJavaDoc)) { return; } String ca = arg.getCommentAfter(), cb = arg.getCommentBefore(); if (ca == null && cb == null) { return; } Function f = arg.findParentOfType(Function.class); if (f == null) { return; } ca = cleanCom(ca); cb = cleanCom(cb); if (!result.config.noComments) { f.addToCommentBefore("@param " + arg.getName() + " " + StringUtils.implode(new String[]{ca, cb}, "<br>")); } arg.setCommentAfter(null); arg.setCommentBefore(null); } }
@Override public void visitArg(Arg arg) { super.visitArg(arg); if (arg.getName() == null) { return; } if (!result.config.features.contains(GenFeatures.FunctionArgsJavaDoc)) { return; } String ca = arg.getCommentAfter(), cb = arg.getCommentBefore(); if (ca == null && cb == null) { return; } Function f = arg.findParentOfType(Function.class); if (f == null) { return; } ca = cleanCom(ca); cb = cleanCom(cb); if (!result.config.noComments) { f.addToCommentBefore("@param " + arg.getName() + " " + StringUtils.implode(new String[]{ca, cb}, "<br>")); } arg.setCommentAfter(null); arg.setCommentBefore(null); } }