Community
Participate
Working Groups
Similar to IBinding.isDeprecated(), it will be helpful if IBinding also have another method to return JDK version from @since javadoc tag. e.g @since JDK1.2 return JDK1.2
DOM AST will soon provide support for surfacing comments. In particular, you should be able to look for any given tag defined in a javadoc.
General purpose comment support got added to DOM AST API. *** This bug has been marked as a duplicate of 50683 ***
With new API, here a code sample which can match your requirement: Javadoc docComment = methodDeclaration.getjavadoc(); Iterator tags = docComment.tags().listIterator(); String version = null; while (tags.hasNext()) { TagElement tagElement = (TagElement) tags.next(); if ("@since".equals(tagElement.getTagName())) { // tag name may be null! if (tagElement.fragments().size() > 0) { ASTNode fragment = (ASTNode) fragment.next(); if (fragment.getNodeType() == ASTNode.TEXT_ELEMENT) { TextElement text = (TextElement) fragment; version = text.getText(); break; } } } // Here you have version = "JDK1.2" :))
Sorry: Javadoc docComment = methodDeclaration.getJavadoc(); ... assuming that methodDeclaration is kind of org.eclipse.jdt.core.dom.BodyDeclaration