001
014
015 package com.liferay.portal.exception;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.util.ClassUtil;
019 import com.liferay.portal.security.auth.FullNameValidator;
020
021
024 public class ContactNameException extends PortalException {
025
026 public static class MustHaveFirstName extends ContactNameException {
027
028 public MustHaveFirstName() {
029 super("Contacts must have a first name");
030 }
031
032 }
033
034 public static class MustHaveLastName extends ContactNameException {
035
036 public MustHaveLastName() {
037 super("Contacts must have a last name");
038 }
039
040 }
041
042 public static class MustHaveMiddleName extends ContactNameException {
043
044 public MustHaveMiddleName() {
045 super("Contacts must have a middle name");
046 }
047
048 }
049
050 public static class MustHaveValidFullName extends ContactNameException {
051
052 public MustHaveValidFullName(FullNameValidator fullNameValidator) {
053 super(
054 String.format(
055 "Contact full name must validate with %s",
056 ClassUtil.getClassName(fullNameValidator)));
057
058 this.fullNameValidator = fullNameValidator;
059 }
060
061 public final FullNameValidator fullNameValidator;
062
063 }
064
065 private ContactNameException(String msg) {
066 super(msg);
067 }
068
069 }