本文整理汇总了Java中org.apache.commons.lang.StringUtils.isWhitespace方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.isWhitespace方法的具体用法?Java StringUtils.isWhitespace怎么用?Java StringUtils.isWhitespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang.StringUtils
的用法示例。
在下文中一共展示了StringUtils.isWhitespace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generatePackageFiles
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
protected void generatePackageFiles(RootDoc root, WRDoc wrDoc) {
PackageDoc[] packageDocs = root.specifiedPackages();
for (PackageDoc pdoc : packageDocs) {
if (StringUtils.isNotBlank(pdoc.commentText())) {
String html = this.pegDownProcessor.markdownToHtml(pdoc
.commentText());
Map<String, String> tagMap = new HashMap<String, String>();
tagMap.put("branchName", this.configurationEx.branchname);
tagMap.put("systemName", this.configurationEx.systemname);
String tags = WRTagTaglet.concatToString(pdoc
.tags(WRTagTaglet.NAME));
if (StringUtils.isBlank(tags)) {
tagMap.put("tags", pdoc.name());
} else {
tagMap.put("tags", tags);
}
tagMap.put("APIUrl", pdoc.name());
if (StringUtils.isWhitespace(this.configurationEx.buildid) ||
this.configurationEx.buildid.equalsIgnoreCase("time")) {
tagMap.put("buildID", wrDoc.getDocGeneratedTime());
} else {
tagMap.put("buildID", this.configurationEx.buildid);
}
this.logger.info("buildid:" + tagMap.get("buildID"));
tagMap.put("bodyContent", html);
Tag[] ts = pdoc.tags(WRTagTaglet.NAME);
for(Tag t : ts) {
if (!wrDoc.getTaggedOpenAPIs().containsKey(t.name())) {
wrDoc.getTaggedOpenAPIs().put(t.name(),
new LinkedList<OpenAPI>());
}
}
this.configurationEx
.getWriterFactory()
.getFreemarkerWriter()
.generateHtmlFile("packageInfo.ftl", tagMap,
this.configurationEx.destDirName,
pdoc.name() + ".html");
}
}
}
示例2: generateWRAPIDetailFiles
import org.apache.commons.lang.StringUtils; //导入方法依赖的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);
}
}
}
}