<class name="org.ephman.examples.user.generated.User"> <description>This class represents a User</description> <field name="userId" type="string" required="true"/> <field name="userName" type="string"/> </class>This describes a class and it's fields3.5. Running MapToJava on this XML file will produce a java file in org/ephman/examples/user/generated/ called User.java.3.6 This class will have two protected member variables _userId and _userName, both of type java.lang.String3.7. Also public routines
public String getUserId () public void setUserId (String foo) public String getUserName () public void setUserName (String foo)will be generated for get/set operations on these fields.
Also note the 'description' tag this text is placed at the top of the class (good for Javadoc), and required="true" was placed on the userId field. This won't generate any extra Java code but is a directive to the XML Marshaller (and SQL, Validation) that this field must exist.