- 论坛徽章:
- 0
|
Apache Jakarta Commons Digester 的一些使用笔记
public static Digester createDigester()
{
Digester digester = new Digester();
digester.addObjectCreate("Server", Server.class);
digester.addSetProperties("Server");
digester.addObjectCreate("Server/Proxy", Proxy.class);
digester.addSetProperties("Server/Proxy");
digester.addSetNext("Server/Proxy", "addChild");
digester.addObjectCreate("Server/Proxy/AllowList", ArrayList.class);
digester.addSetNext("Server/Proxy/AllowList", "setAllowList");
digester.addCallMethod("Server/Proxy/AllowList/Host", "add", 0);
digester.addObjectCreate("Server/Proxy/DenyList", ArrayList.class);
digester.addSetNext("Server/Proxy/DenyList", "setDenyList");
digester.addCallMethod("Server/Proxy/DenyList/Host", "add", 0);
return digester;
}
-->
127.0.0.1
www.microsoft.com
bill.microsoft.com
10.202.10.20
--------------------------------------------------------------------------------------------------------------------------------------------
digester.addCallMethod("datasources/datasource", "addDataSource", 5);
digester.addCallParam("datasources/datasource/name", 0);
digester.addCallParam("datasources/datasource/driver", 1);
digester.addCallParam("datasources/datasource/url", 2);
digester.addCallParam("datasources/datasource/username", 3);
digester.addCallParam("datasources/datasource/password", 4);
HsqlDataSource
org.hsqldb.jdbcDriver
jdbc:hsqldb:hsql://localhost
sa
OracleDataSource
oracle.jdbc.driver.OracleDriver
jdbc:oracle:thin:@localhost:1521:orcl
scott
tiger
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4960/showart_15978.html |
|