本文整理汇总了Java中org.codehaus.plexus.util.StringUtils.join方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.join方法的具体用法?Java StringUtils.join怎么用?Java StringUtils.join使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.plexus.util.StringUtils
的用法示例。
在下文中一共展示了StringUtils.join方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDescription
import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
private String getDescription(String artifactId) {
String[] strings = Stream.of(artifactId.split("-"))
.map(StringUtils::capitalizeFirstLetter)
.toArray(String[]::new);
String join = StringUtils.join(strings, " ");
String appSuffix = applicationType.equals("stream") ? "Binder Application" : "Application";
return String.format("%s %s %s %s", "Spring Cloud", StringUtils.capitalizeFirstLetter(applicationType),
join, appSuffix);
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream-app-maven-plugin,代码行数:10,代码来源:SpringCloudStreamAppMojo.java
示例2: getFiles
import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private List<File> getFiles() throws IOException {
final String includesString = (getIncludes() == null || getIncludes().length == 0) ? "**/*.java"
: StringUtils.join(getIncludes(), ",");
final String excludesString = (getExcludes() == null || getExcludes().length == 0) ? null
: StringUtils.join(getExcludes(), ",");
return FileUtils.getFiles(getSourceDirectory(), includesString, excludesString);
}
示例3: onActivityResult
import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//If Voice recognition is successful then it returns RESULT_OK
if (requestCode == VOICE_RECOGNITION_REQUEST_CODE)
{
if (resultCode == RESULT_OK) {
ArrayList<String> textMatchList = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
if (!textMatchList.isEmpty()) {
String voiceMessage = StringUtils.join(textMatchList.iterator(), "#");
Wearable.MessageApi.sendMessage(apiClient, remoteNodeId, COMMAND_PATH, voiceMessage.getBytes());
}
//Result code for various error.
} else if (resultCode == RecognizerIntent.RESULT_AUDIO_ERROR) {
showToastMessage("Audio Error");
} else if (resultCode == RecognizerIntent.RESULT_CLIENT_ERROR) {
showToastMessage("Client Error");
} else if (resultCode == RecognizerIntent.RESULT_NETWORK_ERROR) {
showToastMessage("Network Error");
} else if (resultCode == RecognizerIntent.RESULT_NO_MATCH) {
showToastMessage("No Match");
} else if (resultCode == RecognizerIntent.RESULT_SERVER_ERROR) {
showToastMessage("Server Error");
}
//TODO: no message sent may be possible.
}
super.onActivityResult(requestCode, resultCode, data);
}
示例4: validateFileOrDirectoryName
import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
private static void validateFileOrDirectoryName(final File fileOrDir) {
if (Os.isFamily(Os.FAMILY_WINDOWS) && !FileUtils.isValidWindowsFileName(fileOrDir)) {
throw new IllegalArgumentException(
"The file (" + fileOrDir + ") cannot contain any of the following characters: \n"
+ StringUtils.join(INVALID_CHARACTERS_FOR_WINDOWS_FILE_NAME, " "));
}
}
示例5: convertInExcludes
import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
private String convertInExcludes(List<String> cludes) {
if (cludes == null) {
return null;
}
final String converted = StringUtils.join(cludes.iterator(), ",");
if (converted.length() == 0) {
return null;
}
return converted;
}
示例6: handleArguments
import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
private void handleArguments( List<String> commandArguments )
throws MojoExecutionException, IOException
{
for ( int i = 0; i < arguments.size(); i++ )
{
Object argument = arguments.get( i );
String arg;
if ( argument instanceof String && isLongClassPathArgument( (String) argument ) )
{
// it is assumed that starting from -cp or -classpath the arguments
// are: -classpath/-cp %classpath mainClass
// the arguments are replaced with: -jar $TMP/maven-exec.jar
// NOTE: the jar will contain the classpath and the main class
commandArguments.add( "-jar" );
File tmpFile = createJar( computePath( (Classpath) arguments.get( i + 1 ) ),
(String) arguments.get( i + 2 ) );
commandArguments.add( tmpFile.getAbsolutePath() );
i += 2;
}
if ( argument instanceof String && isLongModulePathArgument( (String) argument ) )
{
String filePath = "target/modulepath";
commandArguments.add( '@' + filePath );
String modulePath = StringUtils.join( computePath( (Modulepath) arguments.get( ++i ) ).iterator(), File.pathSeparator );
createArgFile( filePath, Arrays.asList( "-p", modulePath ) );
}
else if ( argument instanceof Classpath )
{
Classpath specifiedClasspath = (Classpath) argument;
arg = computeClasspathString( specifiedClasspath );
commandArguments.add( arg );
}
else if ( argument instanceof Modulepath )
{
Modulepath specifiedModulepath = (Modulepath) argument;
arg = computeClasspathString( specifiedModulepath );
commandArguments.add( arg );
}
else
{
commandArguments.add( (String) argument );
}
}
}
示例7: assembleArguments
import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
/**
* Assembles a complete ajc compiler arguments list.
*
* @throws MojoExecutionException error in configuration
*/
protected void assembleArguments()
throws MojoExecutionException {
if (XhasMember) {
ajcOptions.add("-XhasMember");
}
// Add classpath
ajcOptions.add("-classpath");
ajcOptions.add(AjcHelper.createClassPath(project, null, getClasspathDirectories()));
// Add boot classpath
if (null != bootclasspath) {
ajcOptions.add("-bootclasspath");
ajcOptions.add(bootclasspath);
}
if (null != Xjoinpoints) {
ajcOptions.add("-Xjoinpoints:" + Xjoinpoints);
}
// Add warn option
if (null != warn) {
ajcOptions.add("-warn:" + warn);
}
if (null != proc) {
ajcOptions.add("-proc:" + proc);
}
if (Xset != null && !Xset.isEmpty()) {
StringBuilder sb = new StringBuilder("-Xset:");
for (Map.Entry<String, String> param : Xset.entrySet()) {
sb.append(param.getKey());
sb.append("=");
sb.append(param.getValue());
sb.append(',');
}
ajcOptions.add(sb.substring(0, sb.length() - 1));
}
// Add artifacts or directories to weave
String joinedWeaveDirectories = null;
if (weaveDirectories != null) {
joinedWeaveDirectories = StringUtils.join(weaveDirectories, File.pathSeparator);
}
addModulesArgument("-inpath", ajcOptions, weaveDependencies, joinedWeaveDirectories,
"dependencies and/or directories to weave");
// Add library artifacts
addModulesArgument("-aspectpath", ajcOptions, aspectLibraries, getAdditionalAspectPaths(),
"an aspect library");
// Add xmlConfigured option and argument
if (null != xmlConfigured) {
ajcOptions.add("-xmlConfigured");
ajcOptions.add(xmlConfigured.getAbsolutePath());
}
// add target dir argument
ajcOptions.add("-d");
ajcOptions.add(getOutputDirectory().getAbsolutePath());
// Add all the files to be included in the build,
if (null != ajdtBuildDefFile) {
resolvedIncludes = AjcHelper.getBuildFilesForAjdtFile(ajdtBuildDefFile, basedir);
} else {
resolvedIncludes = getIncludedSources();
}
ajcOptions.addAll(resolvedIncludes);
}