import org.apache.ws.jaxme.test.misc.address.AddressType.PhoneDetailsType.PhoneType;
public class AddressCreator {
public static void writeAddress(Writer pWriter) throws JAXBException {
ObjectFactory f = new ObjectFactory();
// Create the element:
Address addr = f.createAddress();
addr.setName(f.createAddressTypeNameType());
addr.getName().setFirst("Jane");
addr.getName().setLast("Doe");
addr.setPostal(f.createAddressTypePostalType());
addr.getPostal().setStreet("34 Main Street");
addr.getPostal().setCity("Boston");
addr.getPostal().setState("MA");
addr.getPostal().setZIP("02215");
addr.setEmailDetails(f.createAddressTypeEmailDetailsType());
EmailType email = f.createAddressTypeEmailDetailsTypeEmailType();
email.setType("Private");
email.setEmailAddress("jdoe@yourcompany.com");
addr.getEmailDetails().getEmail().add(email);
email = f.createAddressTypeEmailDetailsTypeEmailType();
email.setType("Office");
email.setEmailAddress("josephdoe@mycompany.com");
addr.getEmailDetails().getEmail().add(email);
email = f.createAddressTypeEmailDetailsTypeEmailType();
email.setType("Office");
email.setEmailAddress("joseph.doe@mycompany.com");
addr.getEmailDetails().getEmail().add(email);
addr.setPhoneDetails(f.createAddressTypePhoneDetailsType());
PhoneType phone = f.createAddressTypePhoneDetailsTypePhoneType();
phone.setType("Work");
phone.setPhoneNumber("555.6789");
addr.getPhoneDetails().getPhone().add(phone);
phone = f.createAddressTypePhoneDetailsTypePhoneType();
phone.setType("Fax");
phone.setPhoneNumber("555.1212");
addr.getPhoneDetails().getPhone().add(phone);
// And save it into the file "Address.xml"