commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giorgio Gallo <giorg...@overlord.it>
Subject commons-concoct - new project proposal
Date Wed, 30 Nov 2005 23:12:40 GMT

I've been working on a library I aim to contribute to the commons
bazaar (as a standalone lib or maybe as part of commons-transform), but:

- I'm not sure mine is a good idea for a commons library
- I'm not a commons committer
- The lib still needs work (it is a prototype right now)

The library, which is named Concoct for now, should come handy in
configuration files (that is, I think so :).

Its purpose is to parse URI-like strings (anything in the form
"somescheme:somestring") into java objects according to a
scheme-specific syntax (which is straightforward in most cases): for now
it can only handle strings like

"int:189"
-> new Integer(189)

"string:foo"
-> new String("foo")

"null:whatever"
-> null

"class:oracle.jdbc.driver.OracleDriver"
-> oracle.jdbc.driver.OracleDriver.class

and convert expressions like

"bean:org.example.MyClass(foo=string:foo,bar=null:null)"
into an instance of MyClass, with attributes set as specified.

Plans are to add many other "schemes", eg:
- "jdbc:" to produce Connections
- "jdbc-datasource:" to produce DataSources (via commons-dbcp)
- "singleton:" to return the same Object if the expression is evaluated
more than once
- "proxy:" to build a dynamic proxy
- "file:","http:","ftp:" to read the specified url into a java.net.URL
- "deserialize:" to read an object from an URL
- ...

The idea is to enable the combination of different schemes in
expressions (such as in the "bean:" scheme example - above).


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message