final static String NODE_SEPARATOR = ".";
final static char STRING_ESCAPE_CHARACTER = '\\';
- public static List splitString(String aString, String aSeparator) {
- List result= new Vector();
- int previousPosition = 0;
- int position;
- int endOfNamePosition;
-
- while ((position = aString.indexOf(aSeparator, previousPosition))>=0) {
- result.add(aString.substring(previousPosition, position));
- previousPosition = position + aSeparator.length();
- }
-
- result.add(aString.substring(previousPosition, aString.length()));
-
- return result;
- }
-
private static Object findNode(String aKey, Map aMap, List aParts, boolean aMakeIfNotPresent) throws Exception {
Iterator i;
String location = "";
public static Object findValueForKey(Map aMap, String aKey) throws Exception {
Object node;
- List parts = splitString(aKey, NODE_SEPARATOR);
+ List parts = StringRoutines.splitString(aKey, NODE_SEPARATOR);
node = findNode(aKey, aMap, parts, false);
}
public static void setValueForKey(Map aMap, String aKey, Object aValue) throws Exception {
- List parts = splitString(aKey, NODE_SEPARATOR);
+ List parts = StringRoutines.splitString(aKey, NODE_SEPARATOR);
String key = (String) parts.get(parts.size()-1);
parts.remove(parts.size()-1);