本文整理汇总了Java中org.apache.commons.lang3.StringUtils.deleteWhitespace方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.deleteWhitespace方法的具体用法?Java StringUtils.deleteWhitespace怎么用?Java StringUtils.deleteWhitespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang3.StringUtils
的用法示例。
在下文中一共展示了StringUtils.deleteWhitespace方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderHead
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(new MarkdownResourceReference()));
String encodedAttachmentSupport;
if (getAttachmentSupport() != null) {
encodedAttachmentSupport = Base64.encodeBase64String(SerializationUtils.serialize(getAttachmentSupport()));
encodedAttachmentSupport = StringUtils.deleteWhitespace(encodedAttachmentSupport);
encodedAttachmentSupport = StringEscapeUtils.escapeEcmaScript(encodedAttachmentSupport);
encodedAttachmentSupport = "'" + encodedAttachmentSupport + "'";
} else {
encodedAttachmentSupport = "undefined";
}
String callback = ajaxBehavior.getCallbackFunction(explicit("action"), explicit("param1"), explicit("param2"),
explicit("param3")).toString();
String autosaveKey = getAutosaveKey();
if (autosaveKey != null)
autosaveKey = "'" + JavaScriptEscape.escapeJavaScript(autosaveKey) + "'";
else
autosaveKey = "undefined";
String script = String.format("gitplex.server.markdown.onDomReady('%s', %s, %d, %s, %d, %b, %b, %s);",
container.getMarkupId(),
callback,
ATWHO_LIMIT,
encodedAttachmentSupport,
getAttachmentSupport()!=null?getAttachmentSupport().getAttachmentMaxSize():0,
getUserMentionSupport() != null,
getPullRequestReferenceSupport() != null,
autosaveKey);
response.render(OnDomReadyHeaderItem.forScript(script));
script = String.format("gitplex.server.markdown.onWindowLoad('%s');", container.getMarkupId());
response.render(OnLoadHeaderItem.forScript(script));
}
示例2: getExecCommandForHeapDump
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
/**
* Generate parameters for JVM Heap dump
*
* @param scriptName
* @param jvm
* @return
*/
private ExecCommand getExecCommandForHeapDump(String scriptName, Jvm jvm) {
final String trimmedJvmName = StringUtils.deleteWhitespace(jvm.getJvmName());
final String jvmRootDir = Paths.get(jvm.getTomcatMedia().getRemoteDir().toString() + '/' + trimmedJvmName + '/' +
jvm.getTomcatMedia().getRootDir()).normalize().toString();
final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyyMMdd.HHmmss");
final String dumpFile = "heapDump." + trimmedJvmName + "." + formatter.print(DateTime.now());
final String dumpLiveStr = ApplicationProperties.getAsBoolean(PropertyKeys.JMAP_DUMP_LIVE_ENABLED.name()) ? "live," : "\"\"";
final String heapDumpDir = jvm.getTomcatMedia().getRemoteDir().normalize().toString() + "/" + jvm.getJvmName();
return new ExecCommand(getFullPathScript(jvm, scriptName), jvm.getJavaHome(), heapDumpDir, dumpFile,
dumpLiveStr , jvmRootDir, jvm.getJvmName());
}
示例3: formatPostcode
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public static String formatPostcode(String postcode) {
String formattedPostcode = StringUtils.deleteWhitespace(postcode.toUpperCase());
if ((formattedPostcode.length() >= 5) && (formattedPostcode.length() <= 7)) {
formattedPostcode =
StringUtils.substring(formattedPostcode, 0, formattedPostcode.length() - 3)
+ " "
+ StringUtils.substring(formattedPostcode, formattedPostcode.length() - 3);
}
return formattedPostcode;
}
示例4: getExecCommandForDeploy
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
/**
* Method to generate remote command for extracting jar for jvm
*
* @param jvm
* @return
*/
private ExecCommand getExecCommandForDeploy(Jvm jvm) {
final String remoteScriptDir = ApplicationProperties.getRequired(PropertyKeys.REMOTE_SCRIPT_DIR);
final String trimmedJvmName = StringUtils.deleteWhitespace(jvm.getJvmName());
final String archivePath = Paths.get(remoteScriptDir + '/' + trimmedJvmName + '/'
+ DEPLOY_CONFIG_ARCHIVE_SCRIPT_NAME).normalize().toString();
final String jvmJarFile = Paths.get(remoteScriptDir + '/' + trimmedJvmName + ".jar").normalize().toString();
final String jvmInstanceDir = Paths.get(jvm.getTomcatMedia().getRemoteDir().toString() + '/' + trimmedJvmName)
.normalize().toString();
final String jdkJarDir = Paths.get(jvm.getJavaHome() + "/bin/jar").normalize().toString();
return new ExecCommand(archivePath, jvmJarFile, jvmInstanceDir, jdkJarDir);
}
示例5: convertToCamelCase
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
private static String convertToCamelCase(final String inString) {
String str = inString.trim();
if (StringUtils.contains(str, '-') || StringUtils.contains(str, ' ')) {
str = inString.replace('-', ' ');
str = WordUtils.capitalizeFully(str);
str = StringUtils.deleteWhitespace(str);
}
return StringUtils.uncapitalize(str);
}
示例6: setTitle
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public void setTitle(String title) {
this.title = title;
noSpaceTitle = StringUtils.deleteWhitespace(title);
}
示例7: formatPid
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
private static String formatPid(String pid) {
if (pid == null)
return null;
return StringUtils.deleteWhitespace(pid);
}
示例8: handleSingleStr
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
protected String handleSingleStr(String input) {
return StringUtils.deleteWhitespace(input);
}
示例9: parse
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
public static LocalDateTime parse(String dateTime) throws ParseException {
Validate.notNull(dateTime);
dateTime = StringUtils.deleteWhitespace(dateTime);
dateTime = removeSecondComponent(dateTime);
if (dateTime == "")
return null;
if (!isValidTs(dateTime))
throw new ParseException("Invalid date/time");
// String timeZone = getTimeZone(dateTime);
dateTime = removeTimeZone(dateTime);
if (dateTime.length() < 8)
dateTime = handleShortDates(dateTime);
String pattern = getPattern(dateTime);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
if (dateTime.length() == 8)
return LocalDate.parse(dateTime, formatter).atStartOfDay();
return LocalDateTime.parse(dateTime, formatter);
}