+ // Are all parameter set?
+ if (null == recipientAddress) {
+ // Throw NPE
+ throw new NullPointerException("recipientAddress is null"); //NOI18N
+ } else if (null == subjectLine) {
+ // Throw it again
+ throw new NullPointerException("subjectLine is null"); //NOI18N
+ } else if (subjectLine.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("subjectLine is empty"); //NOI18N
+ } else if (null == templateName) {
+ // Throw NPE
+ throw new NullPointerException("templateName is null"); //NOI18N
+ } else if (templateName.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("templateName is empty"); //NOI18N
+ } else if (null == templateVariables) {
+ // Throw NPE
+ throw new NullPointerException("templateVariables is null"); //NOI18N
+ } else if (templateVariables.isEmpty()) {
+ // At least one parameter should be there
+ throw new IllegalArgumentException("templatesVariables should have at least one parameter set."); //NOI18N
+ } else if (null == locale) {
+ // Throw NPE
+ throw new NullPointerException("locale is null"); //NOI18N
+ }
+