public static boolean hasJavadocDeprecatedTag(Tree tree) { return hasJavadocDeprecatedTag(PublicApiChecker.getApiJavadoc(tree)); }
public boolean hasJavadocDeprecatedTag(Tree tree) { String javadoc = publicApiChecker.getApiJavadoc(tree); return hasJavadocDeprecatedTag(javadoc); }
public static boolean hasJavadocDeprecatedTag(Tree tree) { return hasJavadocDeprecatedTag(PublicApiChecker.getApiJavadoc(tree)); }
private void visitNode(Tree tree) { Tree currentParent = currentParents.peek(); if (tree.is(PublicApiChecker.CLASS_KINDS)) { classTrees.push((ClassTree) tree); currentParents.push(tree); } else if (tree.is(PublicApiChecker.METHOD_KINDS)) { currentParents.push(tree); } if (isPublicApi(currentParent, tree)) { publicApi++; if (getApiJavadoc(tree) != null) { documentedPublicApi++; } } }
private void visitNode(Tree tree) { Tree currentParent = currentParents.peek(); if (tree.is(PublicApiChecker.CLASS_KINDS)) { classTrees.push((ClassTree) tree); currentParents.push(tree); } else if (tree.is(PublicApiChecker.METHOD_KINDS)) { currentParents.push(tree); } if (isPublicApi(currentParent, tree)) { publicApi++; if (getApiJavadoc(tree) != null) { documentedPublicApi++; } } }
private void visitNode(Tree tree) { Tree currentParent = currentParents.peek(); if (tree.is(PublicApiChecker.CLASS_KINDS)) { classTrees.push((ClassTree) tree); currentParents.push(tree); } else if (tree.is(PublicApiChecker.METHOD_KINDS)) { currentParents.push(tree); } if (isPublicApi(currentParent, tree)) { publicApi++; if (getApiJavadoc(tree) != null) { documentedPublicApi++; } } }
private void visitNode(Tree tree) { Tree currentParent = currentParents.peek(); if (tree.is(PublicApiChecker.CLASS_KINDS)) { classTrees.push((ClassTree) tree); currentParents.push(tree); } else if (tree.is(PublicApiChecker.METHOD_KINDS)) { currentParents.push(tree); } if (isPublicApi(currentParent, tree)) { publicApi++; if (getApiJavadoc(tree) != null) { documentedPublicApi++; } } }
public Javadoc(Tree tree) { if (tree.is(METHOD_KINDS)) { elementParameters = ((MethodTree) tree).parameters().stream() .map(VariableTree::simpleName) .map(IdentifierTree::name) .collect(Collectors.toList()); elementExceptionNames = ((MethodTree) tree).throwsClauses().stream() .map(Javadoc::exceptionName) .filter(Objects::nonNull) .collect(Collectors.toList()); } else if (tree.is(CLASS_KINDS)) { elementParameters = ((ClassTree) tree).typeParameters().stream() .map(TypeParameterTree::identifier) .map(IdentifierTree::name) .map(name -> "<" + name + ">") .collect(Collectors.toList()); elementExceptionNames = Collections.emptyList(); } else { elementParameters = Collections.emptyList(); elementExceptionNames = Collections.emptyList(); } List<String> javadocLines = cleanLines(PublicApiChecker.getApiJavadoc(tree)); mainDescription = getDescription(javadocLines, -1, ""); blockTagDescriptions = extractBlockTags(javadocLines, Arrays.asList(BlockTag.values())); undocumentedNamedTags = new EnumMap<>(BlockTag.class); }
public Javadoc(Tree tree) { if (tree.is(METHOD_KINDS)) { elementParameters = ((MethodTree) tree).parameters().stream() .map(VariableTree::simpleName) .map(IdentifierTree::name) .collect(Collectors.toList()); elementExceptionNames = ((MethodTree) tree).throwsClauses().stream() .map(Javadoc::exceptionName) .filter(Objects::nonNull) .collect(Collectors.toList()); } else if (tree.is(CLASS_KINDS)) { elementParameters = ((ClassTree) tree).typeParameters().stream() .map(TypeParameterTree::identifier) .map(IdentifierTree::name) .map(name -> "<" + name + ">") .collect(Collectors.toList()); elementExceptionNames = Collections.emptyList(); } else { elementParameters = Collections.emptyList(); elementExceptionNames = Collections.emptyList(); } List<String> javadocLines = cleanLines(PublicApiChecker.getApiJavadoc(tree)); mainDescription = getDescription(javadocLines, -1, ""); blockTagDescriptions = extractBlockTags(javadocLines, Arrays.asList(BlockTag.values())); undocumentedNamedTags = new EnumMap<>(BlockTag.class); }
private void visitNode(Tree tree) { if (!isExcluded(tree)) { String javadoc = publicApiChecker.getApiJavadoc(tree); if (javadoc == null) { context.addIssue(tree, this, "Document this public " + getType(tree) + "."); } else if (!javadoc.contains("{@inheritDoc}")) { List<String> undocumentedParameters = getUndocumentedParameters(javadoc, getParameters(tree)); if (!undocumentedParameters.isEmpty()) { context.addIssue(tree, this, "Document the parameter(s): " + Joiner.on(", ").join(undocumentedParameters)); } if (hasNonVoidReturnType(tree) && !hasReturnJavadoc(javadoc)) { context.addIssue(tree, this, "Document this method return value."); } } } }