org.springframework.security.oauth2.client.http
类 StringSplitUtils

java.lang.Object
  继承者 org.springframework.security.oauth2.client.http.StringSplitUtils

public class StringSplitUtils
extends Object

Provides several String manipulation methods. Copied from deleted org.springframework.security.util.StringSplitUtils


构造方法摘要
StringSplitUtils()
           
 
方法摘要
static String[] split(String toSplit, String delimiter)
          Splits a String at the first instance of the delimiter.
static Map<String,String> splitEachArrayElementAndCreateMap(String[] array, String delimiter, String removeCharacters)
          Takes an array of Strings, and for each element removes any instances of removeCharacter, and splits the element based on the delimiter.
static String[] splitIgnoringQuotes(String str, char separatorChar)
          Splits a given string on the given separator character, skips the contents of quoted substrings when looking for separators.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

StringSplitUtils

public StringSplitUtils()
方法详细信息

split

public static String[] split(String toSplit,
                             String delimiter)
Splits a String at the first instance of the delimiter.

Does not include the delimiter in the response.

参数:
toSplit - the string to split
delimiter - to split the string up with
返回:
a two element array with index 0 being before the delimiter, and index 1 being after the delimiter (neither element includes the delimiter)
抛出:
IllegalArgumentException - if an argument was invalid

splitEachArrayElementAndCreateMap

public static Map<String,String> splitEachArrayElementAndCreateMap(String[] array,
                                                                   String delimiter,
                                                                   String removeCharacters)
Takes an array of Strings, and for each element removes any instances of removeCharacter, and splits the element based on the delimiter. A Map is then generated, with the left of the delimiter providing the key, and the right of the delimiter providing the value.

Will trim both the key and value before adding to the Map.

参数:
array - the array to process
delimiter - to split each element using (typically the equals symbol)
removeCharacters - one or more characters to remove from each element prior to attempting the split operation (typically the quotation mark symbol) or null if no removal should occur
返回:
a Map representing the array contents, or null if the array to process was null or empty

splitIgnoringQuotes

public static String[] splitIgnoringQuotes(String str,
                                           char separatorChar)
Splits a given string on the given separator character, skips the contents of quoted substrings when looking for separators. Introduced for use in DigestProcessingFilter (see SEC-506).

This was copied and modified from commons-lang StringUtils



Copyright © 2013. All rights reserved.