// extract tag
String tagName = "@" + line.substring(0, line.indexOf(' '));
// extract line
line = line.substring(line.indexOf(' ') + 1);
JavaElement ref = creator.createReference(lines, i + 1);
if (ref != null) {
// a root tag for @tagName
JavadocTagElement e = factory.createJavadocTagElement();
e.setJavaParent(ref);
e.setName(tagName);
// parse the line into javadoc elements
// (the line needs to be parsed into fragments before we can find semantic references)
parseSemanticLineIntoFragments(line, factory, e);
// identify semantic rules back
handleModelReferences(e, ref, root, helper);
}
} else if (line.startsWith("/**")) {
// get all @tags
String[] tags = getJavadocTags(lines, i);
for (String tag : tags) {
if (!tag.contains(" ")) {
throw new RuntimeException("Malformed Javadoc tag, expected a space: '" + line + "'");
}
// extract tag
String tagName = tag.substring(0, tag.indexOf(' '));
// extract line
tag = tag.substring(tag.indexOf(' ') + 1);
JavaElement ref = creator.createReference(lines, i + 1);
if (ref != null) {
// a root tag for @tagName
JavadocTagElement e = factory.createJavadocTagElement();
e.setJavaParent(ref);