Java Code Examples for org.apache.commons.lang.StringUtils.isWhitespace()

The following are Jave code examples for showing how to use isWhitespace() of the org.apache.commons.lang.StringUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: htmldoclet4jdk8   File: HtmlDoclet.java   View Source Code Vote up 4 votes
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");
		}
	}
}
 
Example 2
Project: htmldoclet4jdk8   File: HtmlDoclet.java   View Source Code Vote up 4 votes
/**
 * 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);
			}
		}
	}
}
 
Example 3
Project: htmldoclet4jdk7   File: HtmlDoclet.java   View Source Code Vote up 4 votes
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");
		}
	}
}
 
Example 4
Project: htmldoclet4jdk7   File: HtmlDoclet.java   View Source Code Vote up 4 votes
/**
 * 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);
			}
		}
	}
}