super();
nsURI = "http://www.oreilly.com/catalog/javajaxb";
xmlName = "employees";
XMLFieldDescriptorImpl desc = null;
XMLFieldHandler handler = null;
FieldValidator fieldValidator = null;
//-- set grouping compositor
setCompositorAsSequence();
//-- initialize attribute descriptors
//-- initialize element descriptors
//-- _employeeList
desc = new XMLFieldDescriptorImpl(Employee.class, "_employeeList", "employee", NodeType.Element);
handler = (new XMLFieldHandler() {
public Object getValue( Object object )
throws IllegalStateException
{
Employees target = (Employees) object;
return target.getEmployee();
}
public void setValue( Object object, Object value)
throws IllegalStateException, IllegalArgumentException
{
try {
Employees target = (Employees) object;
target.addEmployee( (Employee) value);
}
catch (Exception ex) {
throw new IllegalStateException(ex.toString());
}
}
public Object newInstance( Object parent ) {
return new Employee();
}
} );
desc.setHandler(handler);
desc.setNameSpaceURI("http://www.oreilly.com/catalog/javajaxb");
desc.setRequired(true);
desc.setMultivalued(true);
addFieldDescriptor(desc);
//-- validation code for: _employeeList
fieldValidator = new FieldValidator();
fieldValidator.setMinOccurs(1);
desc.setValidator(fieldValidator);