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


Java StringUtils.join方法代碼示例

本文整理匯總了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);
}
 
開發者ID:muh6mm3d,項目名稱:jannocessor,代碼行數:10,代碼來源:AbstractJAnnocessorMojo.java

示例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);
}
 
開發者ID:juandesi,項目名稱:android-wear-voice-message,代碼行數:31,代碼來源:WearActivity.java

示例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, " "));
        }
    }
 
開發者ID:mojohaus,項目名稱:jaxb2-maven-plugin,代碼行數:9,代碼來源:FileSystemUtilities.java

示例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;
}
 
開發者ID:jboss-switchyard,項目名稱:switchyard,代碼行數:11,代碼來源:ConfigureMojo.java

示例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 );
        }
    }
}
 
開發者ID:mojohaus,項目名稱:exec-maven-plugin,代碼行數:50,代碼來源:ExecMojo.java

示例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);
}
 
開發者ID:mojohaus,項目名稱:aspectj-maven-plugin,代碼行數:76,代碼來源:AbstractAjcCompiler.java


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