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