SourceForge.net Logo
Version: 0.27 - Last update: 2004-05-30 Home Page - SourceForge Project Page - Contact

Jodd
  Overview
  News
  Download
  License
  References

Development
  Using Jodd
  Javadoc
  JUnit report

Community
  Contribute
  Report a bug

More reading
  Milestone 0.30



Top 25%

BSD
 

Bean loaders

Jodds bean package provides loaders. Loader is a working object that 'knows' how to populate Java bean object from some source, i.e. other object of specific type. For example, Map loader will populate Java bean using the key/value pairs founded in some Map object.

Bean loader example
 
HashMap map = new HashMap();
...				// populate map anyhow
FooBean fb = new FooBean();
BeanUtil.load(fb, map);		// simply as that

Currently, Jodd provides these 3 loaders:
  • Map loader - for loading from any Map instance. May be used for loading values from HashMap, Hashtable, Properties etc.
  • Request loader - for loading from the HttpServletRequest. Very handy for populating form beans.
  • ResultSet loader - for loading from the ResultSet. Handy for populating some entity beans. This loader expect that table column names match specifically bean property names. For example, FOO_COLUMN will match the property named as "FooColumn".

Bean modifiers

Modifiers, on the other hand, are just callback objects that are called for each available property of Java bean.

Modifiers may be used for automatical modification of a set of bean parameters. For example, Jodd provides "Trim String" modifier that simply trims all String properties of the bean, leaving properties of other type intact.


http://jodd.sourceforge.net
najgor at users.sourceforge.net