@Override public boolean hasJavaDoc() { return method.getJavadoc() != null; }
private TagElement findThrowsTag(MethodDeclaration decl, Type exception) { Javadoc javadoc= decl.getJavadoc(); if (javadoc != null) { String name= ASTNodes.getTypeName(exception); return JavadocTagsSubProcessor.findThrowsTag(javadoc, name); } return null; }
private TagElement findThrowsTag(MethodDeclaration decl, Type exception) { Javadoc javadoc= decl.getJavadoc(); if (javadoc != null) { String name= ASTNodes.getTypeName(exception); return JavadocTagsSubProcessor.findThrowsTag(javadoc, name); } return null; }
/** * Decide whether to add a "param" javadoc tag or not. * @param methodDeclaration the method declaration * @return method has javadoc && (method had no parameter before || there is already an @param tag) */ public static boolean shouldAddParamJavadoc(MethodDeclaration methodDeclaration) { Javadoc javadoc= methodDeclaration.getJavadoc(); if (javadoc == null) return false; if (methodDeclaration.parameters().size() == 0) return true; List<TagElement> tags= javadoc.tags(); for (Iterator<TagElement> iter= tags.iterator(); iter.hasNext();) { TagElement element= iter.next(); if (TagElement.TAG_PARAM.equals(element.getTagName())) return true; } return false; }
private TagElement findThrowsTag(MethodDeclaration decl, Name exception) { Javadoc javadoc= decl.getJavadoc(); if (javadoc != null) { String name= ASTNodes.getSimpleNameIdentifier(exception); return JavadocTagsSubProcessor.findThrowsTag(javadoc, name); } return null; }
private TagElement findThrowsTag(MethodDeclaration decl, Type exception) { Javadoc javadoc= decl.getJavadoc(); if (javadoc != null) { String name= ASTNodes.getTypeName(exception); return JavadocTagsSubProcessor.findThrowsTag(javadoc, name); } return null; }
private TagElement findParamTag(MethodDeclaration decl, SingleVariableDeclaration param) { Javadoc javadoc= decl.getJavadoc(); if (javadoc != null) { return JavadocTagsSubProcessor.findParamTag(javadoc, param.getName().getIdentifier()); } return null; }
private TagElement findParamTag(MethodDeclaration decl, SingleVariableDeclaration param) { Javadoc javadoc= decl.getJavadoc(); if (javadoc != null) { return JavadocTagsSubProcessor.findParamTag(javadoc, param.getName().getIdentifier()); } return null; }
private TagElement findParamTag(MethodDeclaration decl, SingleVariableDeclaration param) { Javadoc javadoc= decl.getJavadoc(); if (javadoc != null) { return JavadocTagsSubProcessor.findParamTag(javadoc, param.getName().getIdentifier()); } return null; }
private TagElement findParamTag(MethodDeclaration decl, SingleVariableDeclaration param) { Javadoc javadoc= decl.getJavadoc(); if (javadoc != null) { return JavadocTagsSubProcessor.findParamTag(javadoc, param.getName().getIdentifier()); } return null; }
@Override public JavaDocSource<MethodSource<O>> getJavaDoc() { Javadoc javadoc = method.getJavadoc(); if (javadoc == null) { javadoc = method.getAST().newJavadoc(); method.setJavadoc(javadoc); } return new JavaDocImpl<MethodSource<O>>(this, javadoc); }
private void removeParamTag(ASTRewrite rewrite, SingleVariableDeclaration varDecl) { if (varDecl.getParent() instanceof MethodDeclaration) { Javadoc javadoc= ((MethodDeclaration) varDecl.getParent()).getJavadoc(); if (javadoc != null) { TagElement tagElement= JavadocTagsSubProcessor.findParamTag(javadoc, varDecl.getName().getIdentifier()); if (tagElement != null) { rewrite.remove(tagElement, null); } } } }
private void removeParamTag(ASTRewrite rewrite, SingleVariableDeclaration varDecl) { if (varDecl.getParent() instanceof MethodDeclaration) { Javadoc javadoc= ((MethodDeclaration) varDecl.getParent()).getJavadoc(); if (javadoc != null) { TagElement tagElement= JavadocTagsSubProcessor.findParamTag(javadoc, varDecl.getName().getIdentifier()); if (tagElement != null) { rewrite.remove(tagElement, null); } } } }
private void removeParamTag(ASTRewrite rewrite, SingleVariableDeclaration varDecl) { if (varDecl.getParent() instanceof MethodDeclaration) { Javadoc javadoc= ((MethodDeclaration) varDecl.getParent()).getJavadoc(); if (javadoc != null) { TagElement tagElement= JavadocTagsSubProcessor.findParamTag(javadoc, varDecl.getName().getIdentifier()); if (tagElement != null) { rewrite.remove(tagElement, null); } } } }
private void removeParamTag(ASTRewrite rewrite, SingleVariableDeclaration varDecl, TextEditGroup group) { if (varDecl.getParent() instanceof MethodDeclaration) { Javadoc javadoc= ((MethodDeclaration) varDecl.getParent()).getJavadoc(); if (javadoc != null) { TagElement tagElement= JavadocTagsSubProcessor.findParamTag(javadoc, varDecl.getName().getIdentifier()); if (tagElement != null) { rewrite.remove(tagElement, group); } } } }
private void removeParamTag(ASTRewrite rewrite, SingleVariableDeclaration varDecl, TextEditGroup group) { if (varDecl.getParent() instanceof MethodDeclaration) { Javadoc javadoc= ((MethodDeclaration) varDecl.getParent()).getJavadoc(); if (javadoc != null) { TagElement tagElement= JavadocTagsSubProcessor.findParamTag(javadoc, varDecl.getName().getIdentifier()); if (tagElement != null) { rewrite.remove(tagElement, group); } } } }
private void removeParamTag(ASTRewrite rewrite, SingleVariableDeclaration varDecl, TextEditGroup group) { if (varDecl.getParent() instanceof MethodDeclaration) { Javadoc javadoc= ((MethodDeclaration) varDecl.getParent()).getJavadoc(); if (javadoc != null) { TagElement tagElement= JavadocTagsSubProcessor.findParamTag(javadoc, varDecl.getName().getIdentifier()); if (tagElement != null) { rewrite.remove(tagElement, group); } } } }
int treeSize() { return memSize() + (this.optionalDocComment == null ? 0 : getJavadoc().treeSize()) + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.typeParameters == null ? 0 : this.typeParameters.listSize()) + (this.methodName == null ? 0 : getName().treeSize()) + (this.returnType == null ? 0 : this.returnType.treeSize()) + this.parameters.listSize() + this.thrownExceptions.listSize() + (this.optionalBody == null ? 0 : getBody().treeSize()); } }
int treeSize() { return memSize() + (this.optionalDocComment == null ? 0 : getJavadoc().treeSize()) + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.typeParameters == null ? 0 : this.typeParameters.listSize()) + (this.methodName == null ? 0 : getName().treeSize()) + (this.optionalReceiverType == null ? 0 : this.optionalReceiverType.treeSize()) + (this.optionalReceiverQualifier == null ? 0 : this.optionalReceiverQualifier.treeSize()) + (this.returnType == null ? 0 : this.returnType.treeSize()) + this.parameters.listSize() + (this.ast.apiLevel < AST.JLS8 ? this.thrownExceptions.listSize() : this.extraDimensions.listSize() + this.thrownExceptionTypes.listSize()) + (this.optionalBody == null ? 0 : getBody().treeSize()); } }
int treeSize() { return memSize() + (this.optionalDocComment == null ? 0 : getJavadoc().treeSize()) + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.typeParameters == null ? 0 : this.typeParameters.listSize()) + (this.methodName == null ? 0 : getName().treeSize()) + (this.optionalReceiverType == null ? 0 : this.optionalReceiverType.treeSize()) + (this.optionalReceiverQualifier == null ? 0 : this.optionalReceiverQualifier.treeSize()) + (this.returnType == null ? 0 : this.returnType.treeSize()) + this.parameters.listSize() + (this.ast.apiLevel < AST.JLS8 ? this.thrownExceptions.listSize() : this.extraDimensions.listSize() + this.thrownExceptionTypes.listSize()) + (this.optionalBody == null ? 0 : getBody().treeSize()); } }