+ // As the form cannot validate the data (required="true"), check it here
+ if (this.getUserName() == null) {
+ // Throw NPE
+ throw new NullPointerException("userName is null"); //NOI18N
+ } else if (this.getUserName().isEmpty()) {
+ // Is empty
+ throw new IllegalArgumentException("userName is null"); //NOI18N
+ } else if (this.beanHelper.getContact() == null) {
+ // No contact instance set, so test required fields: gender, first name and family name
+ if (this.contactController.getGender() == null) {
+ // Throw NPE again
+ throw new NullPointerException("contactController.gender is null"); //NOI18N
+ } else if (this.contactController.getFirstName() == null) {
+ // ... and again
+ throw new NullPointerException("contactController.firstName is null"); //NOI18N
+ } else if (this.adminContactController.getFirstName().isEmpty()) {
+ // ... and again
+ throw new IllegalArgumentException("contactController.firstName is empty"); //NOI18N
+ } else if (this.adminContactController.getFamilyName() == null) {
+ // ... and again
+ throw new NullPointerException("contactController.familyName is null"); //NOI18N
+ } else if (this.contactController.getFamilyName().isEmpty()) {
+ // ... and again
+ throw new IllegalArgumentException("contactController.familyName is empty"); //NOI18N
+ } else if (this.adminContactController.getEmailAddress() == null) {
+ // ... and again
+ throw new NullPointerException("contactController.emailAddress is null"); //NOI18N
+ } else if (this.adminContactController.getEmailAddress().isEmpty()) {
+ // ... and again
+ throw new IllegalArgumentException("contactController.emailAddress is empty"); //NOI18N
+ }
+ }
+