|
From: <tr...@us...> - 2003-07-16 22:45:30
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core
In directory sc8-pr-cvs1:/tmp/cvs-serv4858/modules/core/src/com/babeldoc/core
Modified Files:
TieredConfigurationHelper.java
Log Message:
New pipeline stage factory threading model has been implemented.
Index: TieredConfigurationHelper.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/TieredConfigurationHelper.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TieredConfigurationHelper.java 16 Jul 2003 05:46:01 -0000 1.3
--- TieredConfigurationHelper.java 16 Jul 2003 22:45:26 -0000 1.4
***************
*** 68,71 ****
--- 68,72 ----
import com.babeldoc.core.config.IConfig;
import com.babeldoc.core.config.ConfigService;
+ import com.Ostermiller.util.StringTokenizer;
import java.util.*;
***************
*** 119,134 ****
for(Iterator i = keys.iterator(); i.hasNext();) {
String key = (String)i.next();
! int dotIndex = key.indexOf('.');
! if(dotIndex>0) {
! String name = key.substring(0, dotIndex);
! String rest = key.substring(dotIndex+1);
! String value = config.getString(key);
! Map tconfig = (Map)configs.get(name);
! if(tconfig==null) {
! tconfig = new HashMap();
! configs.put(name, tconfig);
}
! tconfig.put(rest, value);
}
}
--- 120,143 ----
for(Iterator i = keys.iterator(); i.hasNext();) {
String key = (String)i.next();
! String value = config.getString(key);
! StringTokenizer st = new StringTokenizer(key, ".");
! int numTokens = st.countTokens();
! Map working = configs;
!
! int tokenCount = 1;
! while (st.hasMoreTokens()) {
! String token = st.nextToken();
!
! if(tokenCount < numTokens) {
! if (working.get(token) == null) {
! working.put(token, new HashMap());
! }
!
! working = (Map)working.get(token);
! } else {
! working.put(token, value);
}
! ++tokenCount;
}
}
|