本文整理汇总了Java中net.winroad.wrdoclet.data.WRDoc.getWRTags方法的典型用法代码示例。如果您正苦于以下问题:Java WRDoc.getWRTags方法的具体用法?Java WRDoc.getWRTags怎么用?Java WRDoc.getWRTags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.winroad.wrdoclet.data.WRDoc
的用法示例。
在下文中一共展示了WRDoc.getWRTags方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateIndexFile
import net.winroad.wrdoclet.data.WRDoc; //导入方法依赖的package包/类
protected void generateIndexFile(RootDoc root, WRDoc wrDoc)
throws Exception {
List<String> tagList = new ArrayList<String>(wrDoc.getWRTags());
Collator cmp = Collator.getInstance(java.util.Locale.CHINA);
Collections.sort(tagList, cmp);
Map<String, Object> tagMap = new HashMap<String, Object>();
DocData bean = this.generateDocData(wrDoc);
Gson gson = new Gson();
tagMap.put("response", gson.toJson(bean));
tagMap.put("searchengine", this.configurationEx.searchengine);
this.configurationEx
.getWriterFactory()
.getFreemarkerWriter()
.generateHtmlFile("index.ftl", tagMap,
this.configurationEx.destDirName, null);
}
示例2: generateDocData
import net.winroad.wrdoclet.data.WRDoc; //导入方法依赖的package包/类
protected DocData generateDocData(WRDoc wrDoc) {
DocData result = new DocData();
List<String> tagList = new ArrayList<String>(wrDoc.getWRTags());
Collator cmp = Collator.getInstance(java.util.Locale.CHINA);
Collections.sort(tagList, cmp);
for (String tag : tagList) {
result.getFacet_counts()
.getFacet_fields()
.addTagField(tag, wrDoc.getTaggedOpenAPIs().get(tag).size());
Doc doc = new Doc();
doc.setTag(tag);
for (OpenAPI openAPI : wrDoc.getTaggedOpenAPIs().get(tag)) {
API api = new API();
api.setUrl(openAPI.getRequestMapping().getUrl());
api.setTooltip(openAPI.getRequestMapping().getTooltip());
api.setMethodType(openAPI.getRequestMapping().getMethodType());
String filename = generateWRAPIFileName(openAPI
.getRequestMapping().getContainerName(), openAPI
.getRequestMapping().getUrl(), openAPI
.getRequestMapping().getMethodType());
api.setFilepath(filename);
api.setBrief(openAPI.getBrief());
doc.getAPIs().add(api);
}
result.addDoc(doc);
}
return result;
}
示例3: generateWRAPIDetailFiles
import net.winroad.wrdoclet.data.WRDoc; //导入方法依赖的package包/类
/**
* Generate the tag documentation.
*
* @param root
* the RootDoc of source to document.
* @param wrDoc
* the data structure representing the doc to generate.
*/
protected void generateWRAPIDetailFiles(RootDoc root, WRDoc wrDoc) {
List<String> tagList = new ArrayList<String>(wrDoc.getWRTags());
for (String tag : tagList) {
List<OpenAPI> openAPIList = wrDoc.getTaggedOpenAPIs().get(tag);
Set<String> filesGenerated = new HashSet<String>();
for (OpenAPI openAPI : openAPIList) {
Map<String, Object> hashMap = new HashMap<String, Object>();
hashMap.put("openAPI", openAPI);
String tagsStr = openAPI.getTags().toString();
// trim '[' and ']'
hashMap.put("tags", tagsStr.substring(1, tagsStr.length() - 1));
hashMap.put("generatedTime", wrDoc.getDocGeneratedTime());
hashMap.put(
"branchName",
this.configurationEx.branchname);
hashMap.put(
"systemName",
this.configurationEx.systemname);
if (StringUtils.isWhitespace(this.configurationEx.buildid) ||
this.configurationEx.buildid.equalsIgnoreCase("time")) {
hashMap.put("buildID", wrDoc.getDocGeneratedTime());
} else {
hashMap.put(
"buildID",
this.configurationEx.buildid);
}
this.logger.info("buildid:" + hashMap.get("buildID"));
String filename = generateWRAPIFileName(openAPI
.getRequestMapping().getContainerName(), openAPI
.getRequestMapping().getUrl(), openAPI
.getRequestMapping().getMethodType());
hashMap.put("filePath", filename);
if (!filesGenerated.contains(filename)) {
this.configurationEx
.getWriterFactory()
.getFreemarkerWriter()
.generateHtmlFile("wrAPIDetail.ftl", hashMap,
this.configurationEx.destDirName, filename);
filesGenerated.add(filename);
}
}
}
}