how to create attributes, setter and getter dynamically?

Hello, i am a newbie to java programming. Is there any way to create java class with dyanmic attributes, setter and getter method from xml configuration during runtime?Thanks a lot
[194 byte] By [apache_chaoa] at [2007-11-27 4:16:19]
# 1
there are tools that can do that.
jwentinga at 2007-7-12 9:22:48 > top of Java-index,Java Essentials,Java Programming...
# 2
This is a pretty advanced requirement for a newbie. You'll probably learn java more thoroughly if you spend a few weeks writing basic classes before jumping into using code generation. In any case, google loves you. http://www.google.co.uk/search?q=java+code+generation+framework
jennyFromTheBronxa at 2007-7-12 9:22:48 > top of Java-index,Java Essentials,Java Programming...
# 3

hi, thanks for your reply so quick. because i need to find out the solution in a short time. you might be able to direct me to search for it on the right way, let make myself clearer first.

let's say i have xml configuration file looks like

<attribute name=攕urname?gt;java.lang.String</attribute>

<attribute name=攆irstname?gt;java.lang.String</attribute>

and with this xml file, i want to create class which looks like below in runtime

Public class Test{

Private String surname;

Private string firstname;

Public String getSurname(){

Return surname;

}

Public void setSurname(String surname){

This.surname=surname;

}

}

Is there any current api available for doing this?

Really appreciate your help.

apache_chaoa at 2007-7-12 9:22:48 > top of Java-index,Java Essentials,Java Programming...
# 4
Two packages that leap to mind are [url= http://www.castor.org/xml-mapping.html]Castor[/url] and [url= http://xmlbeans.apache.org/]xml-beans[/url]. Xml-beans will generate classes for you based on an XSD, I don't know about Castor
georgemca at 2007-7-12 9:22:48 > top of Java-index,Java Essentials,Java Programming...