當前位置: 首頁>>代碼示例>>Java>>正文


Java StringUtils.isWhitespace方法代碼示例

本文整理匯總了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");
		}
	}
}
 
開發者ID:WinRoad-NET,項目名稱:htmldoclet4jdk8,代碼行數:45,代碼來源:HtmlDoclet.java

示例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);
			}
		}
	}
}
 
開發者ID:WinRoad-NET,項目名稱:htmldoclet4jdk8,代碼行數:52,代碼來源:HtmlDoclet.java


注:本文中的org.apache.commons.lang.StringUtils.isWhitespace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。