use of com.sun.javadoc.Tag in project RESTdoclet by IG-Group.
the class DocTypeUtils method getDeprecatedURIs.
/**
* Return a string array of deprecated URIs for this element, searching for
* DEPRECATED_TAG in the method comment
*
* @param element javadoc element
* @return a string array of deprecated URIs for this element
*/
public static String[] getDeprecatedURIs(final ProgramElementDoc element) {
String[] uris = null;
Tag[] tags = element.tags();
for (final Tag tag : tags) {
final String name = tag.name();
if (StringUtils.contains(name, DEPRECATED_TAG)) {
uris = parseMultiUri(tag.text());
LOG.debug("deprecated uris" + tag.text());
break;
}
}
return uris;
}
use of com.sun.javadoc.Tag in project RESTdoclet by IG-Group.
the class DocTypeUtils method getReturnDoc.
/**
* Generates a comment string from the given method, consisting of the
* method return comment and if the return type is an iggroup type, a list
* of attributes (separated by <br>
* )
*
* @param element method doc
* @return documentation string for the method
*/
public static String getReturnDoc(final MethodDoc element) {
LOG.info("Get return type documentation for method: " + element.toString());
String doc = "";
Tag[] tags = element.tags();
String typeDoc = getTypeDoc(element.returnType());
for (final Tag tag : tags) {
final String name = tag.name();
if (StringUtils.contains(name, RETURN_TAG)) {
doc = tag.text();
if (!typeDoc.isEmpty()) {
doc += "<table><tr><td>" + typeDoc + "</td></tr></table>";
}
break;
}
}
//}
return doc;
}
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()]));
}
}
}
}
use of com.sun.javadoc.Tag in project RoboBinding by RoboBinding.
the class EventTaglet method getTagletOutput.
public TagletOutput getTagletOutput(Doc doc, TagletWriter tagletWriter) throws IllegalArgumentException {
Tag[] tags = doc.tags(NAME);
if (tags.length == 0) {
return null;
}
TagletWriterImpl tagletWriterImpl = (TagletWriterImpl) tagletWriter;
StringBuilder sb = new StringBuilder();
sb.append("<table style=\"border: 2px solid gray\"><caption style=\"text-align:left\"><strong>Supported Events</strong></caption><tr style=\"background-color:#555555; color: #ffffff\"><th>Name</th><th>Event class</th></tr>");
for (int i = 0; i < tags.length; i++) {
Tag tag = tags[i];
Event event = parser.parse(tag);
String translatedClassName = inlineLinkTagTranslator.translate(event.getClassName(), tag, doc, tagletWriterImpl);
sb.append(MessageFormat.format("<tr style=\"background-color:{0}\"><td><strong>{1}</strong></td><td>{2}</td></tr>", (i % 2 == 0) ? "#eeeeef" : "#ffffff", event.getName(), translatedClassName));
}
sb.append("</table></br>");
return new TagletOutputImpl(sb.toString());
}
Aggregations