Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.acegisecurity.util
Class StringSplitUtils

    java.lang.Object
      org.acegisecurity.util.StringSplitUtils

    public class StringSplitUtils

extends Object

Provides several `String` manipulation methods.

Version:
  $Id: StringSplitUtils.java,v 1.3 2005/11/17 00:56:09 benalex Exp $
Author:
  Ben Alex

Constructor Summary
`StringSplitUtils()`

Method Summary
`static String[]` | `split(String toSplit, String delimiter)` Splits a `String` at the first instance of the delimiter.
`static Map` | `splitEachArrayElementAndCreateMap(String[] array, String delimiter, String removeCharacters)` Takes an array of `String`s, and for each element removes any instances of `removeCharacter`, and splits the element based on the `delimiter`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### StringSplitUtils

    public StringSplitUtils()

Method Detail

### 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.

  Parameters:
    `toSplit` - the string to split
    `delimiter` - to split the string up with
  Returns:
    a two element array with index 0 being before the delimiter, and index 1 being after the delimiter (neither element includes the delimiter)
  Throws:
    `IllegalArgumentException` - if an argument was invalid

### splitEachArrayElementAndCreateMap

    public static Map splitEachArrayElementAndCreateMap(String[] array,
                                                        String delimiter,
                                                        String removeCharacters)

  Takes an array of `String`s, 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`.

  Parameters:
    `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
  Returns:
    a `Map` representing the array contents, or `null` if the array to process was null or empty

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.