use of com.sun.javadoc.Tag in project markdown-doclet by Abnaxos.
the class MarkdownDoclet method defaultProcess.
/**
* Default processing of any documentation node.
*
* @param doc The documentation.
* @param fixLeadingSpaces `true` if leading spaces should be fixed.
*
* @see Options#toHtml(String, boolean)
*/
protected void defaultProcess(Doc doc, boolean fixLeadingSpaces) {
try {
StringBuilder buf = new StringBuilder();
buf.append(getOptions().toHtml(doc.commentText(), fixLeadingSpaces));
buf.append('\n');
for (Tag tag : doc.tags()) {
processTag(tag, buf);
buf.append('\n');
}
doc.setRawCommentText(buf.toString());
} catch (final ParserRuntimeException e) {
if (doc instanceof RootDoc) {
printError(new SourcePosition() {
@Override
public File file() {
return options.getOverviewFile();
}
@Override
public int line() {
return 0;
}
@Override
public int column() {
return 0;
}
}, e.getMessage());
} else {
printError(doc.position(), e.getMessage());
}
}
}
use of com.sun.javadoc.Tag in project cytoscape-api by cytoscape.
the class AbstractTagletTester method testToString.
@Test
public void testToString() {
Tag t = mock(Tag.class);
when(t.text()).thenReturn("test text");
assertNotNull(taglet.toString(t));
}
use of com.sun.javadoc.Tag in project cytoscape-api by cytoscape.
the class AbstractTagletTester method testToStringArray.
@Test
public void testToStringArray() {
Tag t = mock(Tag.class);
when(t.text()).thenReturn("test text");
Tag t2 = mock(Tag.class);
when(t2.text()).thenReturn("test text");
Tag[] tags = new Tag[] { t, t2 };
assertNotNull(taglet.toString(tags));
}
use of com.sun.javadoc.Tag in project jangaroo-tools by CoreMedia.
the class Util method extractTags.
public static Tag[] extractTags(Doc holder, String text) {
List tags = new ArrayList();
Matcher tagMatcher = TOP_LEVEL_TAG_PATTERN.matcher(text);
boolean found;
int start = 0;
do {
found = tagMatcher.find();
int end = found ? tagMatcher.start() : text.length();
Tag tag = createTag(holder, text.substring(start, end));
tags.add(tag);
start = end;
} while (found);
return (Tag[]) tags.toArray(new Tag[tags.size()]);
}
use of com.sun.javadoc.Tag in project jangaroo-tools by CoreMedia.
the class DocImpl method initTags.
private void initTags() {
allTags = NO_TAGS;
firstSentenceTags = NO_TAGS;
this.tagsByName = new HashMap();
if (((IdeDeclaration) declaration).getSymModifiers().length > 0) {
String text = Util.tidy(((IdeDeclaration) declaration).getSymModifiers()[0].getWhitespace());
if (text.length() > 0) {
allTags = Util.extractTags(this, text);
firstSentenceTags = Util.extractInlineTags(this, Util.firstSentence(text));
Map /*String->List<Tag>*/
tagsByName = new HashMap();
for (int i = 0; i < allTags.length; i++) {
Tag tag = allTags[i];
List tags = (List) tagsByName.get(tag.name());
if (tags == null) {
tags = new ArrayList();
tagsByName.put(tag.name(), tags);
}
tags.add(tag);
}
for (Iterator iterator = tagsByName.entrySet().iterator(); iterator.hasNext(); ) {
Map.Entry entry = (Map.Entry) iterator.next();
List /*Tag*/
tagList = (List) entry.getValue();
Object tagName = entry.getKey();
this.tagsByName.put(tagName, tagList.toArray(new Tag[tagList.size()]));
}
}
}
}
Aggregations