Class CommentUtil
- java.lang.Object
-
- net.sourceforge.pmd.lang.java.ast.CommentUtil
-
@Deprecated public final class CommentUtil extends Object
Deprecated.This utility class is deprecated and will be removed with PMD 7.0.0. Its methods have been intended to parse javadoc tags. A more useful solution will be added around the AST nodeFormalComment
, which contains as childrenJavadocElement
nodes, which in turn provide access to theJavadocTag
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
javadocContentAfter(String text, int position)
Deprecated.This method is deprecated and will be removed with PMD 7.0.0.static Map<String,Integer>
javadocTagsIn(String comment)
Deprecated.This method is deprecated and will be removed with PMD 7.0.0.static List<String>
multiLinesIn(String comment)
Deprecated.This method will be removed with PMD 7.0.0.static List<String>
trim(List<String> lines)
Deprecated.This method will be removed with PMD 7.0.0.static String
wordAfter(String text, int position)
Deprecated.This method is deprecated and will be removed with PMD 7.0.0.
-
-
-
Method Detail
-
wordAfter
@Deprecated public static String wordAfter(String text, int position)
Deprecated.This method is deprecated and will be removed with PMD 7.0.0. This method has been intended to parse javadoc tags. A more useful solution will be added around the AST nodeFormalComment
, which contains as childrenJavadocElement
nodes, which in turn provide access to theJavadocTag
.Gets the next word (characters until next whitespace, punctuation, or anything that is not a letter or digit) at the given position.- Parameters:
text
- the complete textposition
- the position, at which the word starts- Returns:
- the word
-
javadocContentAfter
@Deprecated public static String javadocContentAfter(String text, int position)
Deprecated.This method is deprecated and will be removed with PMD 7.0.0. This method has been intended to parse javadoc tags. A more useful solution will be added around the AST nodeFormalComment
, which contains as childrenJavadocElement
nodes, which in turn provide access to theJavadocTag
.Gets the remaining line after a specific position.- Parameters:
text
- the complete textposition
- the position from which the comment should be returned- Returns:
- the part of the text
-
javadocTagsIn
@Deprecated public static Map<String,Integer> javadocTagsIn(String comment)
Deprecated.This method is deprecated and will be removed with PMD 7.0.0. This method has been intended to parse javadoc tags. A more useful solution will be added around the AST nodeFormalComment
, which contains as childrenJavadocElement
nodes, which in turn provide access to theJavadocTag
.Finds all the javadoc tags in the (formal) comment. Returns a map from javadoc tag to index position.Note: If a tag is used multiple times, the last occurrence is returned.
- Parameters:
comment
- the raw comment- Returns:
- mapping of javadoc tag to index position
-
multiLinesIn
@Deprecated public static List<String> multiLinesIn(String comment)
Deprecated.This method will be removed with PMD 7.0.0. It has been replaced byComment.getFilteredComment()
.Removes the leading comment marker (like*
) of each line of the comment as well as the start marker (//
,/*
or/**
and the end markers (*/
).- Parameters:
comment
- the raw comment- Returns:
- List of lines of the comments
-
trim
@Deprecated public static List<String> trim(List<String> lines)
Deprecated.This method will be removed with PMD 7.0.0. It is not needed anymore, sinceComment.getFilteredComment()
returns already the filtered and trimmed comment text.Similar to the String.trim() function, this one removes the leading and trailing empty/blank lines from the line list.- Parameters:
lines
- the list of lines, which might contain empty lines- Returns:
- the lines without leading or trailing blank lines.
-
-