Hi Folks,

I'm announcing an API that can convert a java Map to a JavaBean.  Before 
this, I was creating lots of silly inner classes like this (and I know 
I'm not the only JSP developer doing this):

public class EmployeeBean {
   public String getName() { ... }
   public String getEmail() { ... }
   String name;
   String email;
   // etc
}

I even wrote an emacs function to crank these out for me!

Now you can do this:

Class beanClass = BeanCreator.createClassForProperties(new String[] { 
"name", "email" });
Object bean = BeanCreator.createBean(beanClass, theMap);

where theMap contains your property-value mappings.

I looked at DynaClass/DynaBean which I think solves this problem in a 
different way.  My concern with DynaClass is that standard JavaBeans 
tools will not recognize its properties (please correct me if I'm 
wrong).  BeanCreator takes a different approach, actually generating a 
Class at runtime to the JavaBeans specs.

The URL is http://dynclass.sourceforge.net/ and all feedback is welcome.

John


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to