/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Comment contains all information in comment part.
* It allows users to get first sentence of this comment, get
* comment for different tags...
*
* @author Kaiyang Liu (original)
* @author Robert Field (rewrite)
* @author Atul M Dambalkar
* @author Neal Gafter (rewrite)
*/
class Comment {
/**
* sorted comments with different tags.
*/
/**
* text minus any tags.
*/
/**
* Doc environment
*/
/**
* constructor of Comment.
*/
/**
* Separate the comment into the text part and zero to N tags.
* Simple state machine is in one of three states:
* <pre>
* IN_TEXT: parsing the comment text or tag text.
* TAG_NAME: parsing the name of a tag.
* TAG_GAP: skipping through the gap between the tag name and
* the tag text.
* </pre>
*/
@SuppressWarnings("fallthrough")
class CommentStringParser {
/**
* The entry point to the comment string parser
*/
void parseCommentStateMachine() {
final int IN_TEXT = 1;
final int TAG_GAP = 2;
final int TAG_NAME = 3;
boolean newLine = true;
int tagStart = 0;
int textStart = 0;
int lastNonWhite = -1;
switch (state) {
case TAG_NAME:
if (isWhite) {
}
break;
case TAG_GAP:
if (isWhite) {
break;
}
/* fall thru */
case IN_TEXT:
lastNonWhite+1);
}
break;
}
if (ch == '\n') {
newLine = true;
} else if (!isWhite) {
lastNonWhite = inx;
newLine = false;
}
}
// Finish what's currently being processed
switch (state) {
case TAG_NAME:
/* fall thru */
case TAG_GAP:
/* fall thru */
case IN_TEXT:
break;
}
}
/**
* Save away the last parsed item.
*/
} else {
} else {
}
}
}
}
}
}
}
/**
* Return the text of the comment.
*/
return text;
}
/**
* Return all tags in this comment.
*/
}
/**
* Return tags of the specified kind in this comment.
*/
}
}
}
}
/**
* Return throws tags in this comment.
*/
}
}
}
/**
* Return param tags (excluding type param tags) in this comment.
*/
return paramTags(false);
}
/**
* Return type param tags in this comment.
*/
return paramTags(true);
}
/**
* Return param tags in this comment. If typeParams is true
* include only type param tags, otherwise include only ordinary
* param tags.
*/
if (typeParams == p.isTypeParameter()) {
}
}
}
}
/**
* Return see also tags in this comment.
*/
}
}
}
/**
* Return serialField tags in this comment.
*/
if (next instanceof SerialFieldTag) {
}
}
}
/**
* Return array of tags with text and inline See Tags for a Doc comment.
*/
if (len == 0) {
}
while (true) {
int linkstart;
textstart)) == -1) {
break;
} else {
int seetextstart = linkstart;
char c = inlinetext.charAt(i);
if (Character.isWhitespace(c) ||
c == '}') {
seetextstart = i;
break;
}
}
//Move past the white space after the inline tag name.
charAt(seetextstart))) {
"tag.Improper_Use_Of_Link_Tag",
} else {
seetextstart++;
}
}
//Missing closing '}' character.
// store the text as it is with the {@link.
"tag.End_delimiter_missing_for_possible_SeeTag",
} else {
//Found closing '}' character.
} else {
}
}
}
break;
}
}
}
/**
* Recursively find the index of the closing '}' character for an inline tag
* and return it. If it can't be found, return -1.
* @param inlineText the text to search in.
* @param searchStart the index of the place to start searching at.
* @return the index of the closing '}' character for an inline tag.
* If it can't be found, return -1.
*/
int delimEnd, nestedOpenBrace;
return -1;
//Found a nested open brace.
return (nestedCloseBrace != -1) ?
-1;
} else {
return delimEnd;
}
}
/**
* Recursively search for the string "{@" followed by
* name of inline tag and white space,
* if found
* return the index of the text following the white space.
* else
* return -1.
*/
return -1;
//Missing '}'.
return -1;
} else {
return linkstart;
}
}
/**
* Return array of tags for the locale specific first sentence in the text.
*/
return getInlineTags(holder,
}
/**
* Return text for this Doc comment.
*/
return text;
}
}