001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/metaobj/tags/sakai_2-4-1/metaobj-api/api/src/java/org/sakaiproject/metaobj/utils/xml/NormalizationException.java $
003: * $Id: NormalizationException.java 21196 2007-02-09 18:57:43Z john.ellis@rsmart.com $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.metaobj.utils.xml;
021:
022: /**
023: * Created by IntelliJ IDEA.
024: * User: John Ellis
025: * Date: Apr 15, 2004
026: * Time: 11:28:09 AM
027: * To change this template use File | Settings | File Templates.
028: */
029: public class NormalizationException extends RuntimeException {
030:
031: public static final String INVALID_LENGTH_ERROR_CODE = "INVALID_LENGTH_ERROR_CODE";
032: public static final String INVALID_LENGTH_TOO_LONG_ERROR_CODE = "INVALID_LENGTH_TOO_LONG_ERROR_CODE";
033: public static final String INVALID_LENGTH_TOO_SHORT_ERROR_CODE = "INVALID_LENGTH_TOO_SHORT_ERROR_CODE";
034: public static final String INVALID_PATTERN_MATCH_ERROR_CODE = "INVALID_PATTERN_MATCH_ERROR_CODE";
035: public static final String NOT_IN_ENUMERATION_ERROR_CODE = "NOT_IN_ENUMERATION_ERROR_CODE";
036:
037: public static final String DATE_TOO_LATE_ERROR_CODE = "DATE_TOO_LATE_ERROR_CODE";
038: public static final String DATE_TOO_EARLY_ERROR_CODE = "DATE_TOO_EARLY_ERROR_CODE";
039: public static final String DATE_AFTER_ERROR_CODE = "DATE_AFTER_ERROR_CODE";
040: public static final String DATE_BEFORE_ERROR_CODE = "DATE_BEFORE_ERROR_CODE";
041: public static final String DATE_INVALID_ERROR_CODE = "DATE_INVALID_ERROR_CODE";
042:
043: public static final String REQIRED_FIELD_ERROR_CODE = "REQIRED_FIELD_ERROR_CODE";
044:
045: public static final String TOO_LARGE_INCLUSIVE_ERROR_CODE = "TOO_LARGE_INCLUSIVE_ERROR_CODE";
046: public static final String TOO_SMALL_INCLUSIVE_ERROR_CODE = "TOO_SMALL_INCLUSIVE_ERROR_CODE";
047: public static final String TOO_LARGE_ERROR_CODE = "TOO_LARGE_ERROR_CODE";
048: public static final String TOO_SMALL_ERROR_CODE = "TOO_SMALL_ERROR_CODE";
049: public static final String TOO_MANY_DIGITS_ERROR_CODE = "TOO_MANY_DIGITS_ERROR_CODE";
050: public static final String INVALID_DECIMAL_NUMBER_ERROR_CODE = "INVALID_DECIMAL_NUMBER_ERROR_CODE";
051: public static final String INVALID_NUMBER_ERROR_CODE = "INVALID_NUMBER_ERROR_CODE";
052:
053: public static final String INVALID_TYPE_ERROR_CODE = "INVALID_TYPE_ERROR_CODE";
054:
055: public static final String INVALID_URI = "INVALID_URI";
056:
057: private String errorCode;
058: private Object[] errorInfo;
059:
060: /**
061: * Constructs a new runtime exception with <code>null</code> as its
062: * detail message. The cause is not initialized, and may subsequently be
063: * initialized by a call to {@link #initCause}.
064: */
065: public NormalizationException() {
066: super ();
067: }
068:
069: /**
070: * Constructs a new runtime exception with the specified detail message.
071: * The cause is not initialized, and may subsequently be initialized by a
072: * call to {@link #initCause}.
073: *
074: * @param message the detail message. The detail message is saved for
075: * later retrieval by the {@link #getMessage()} method.
076: */
077: public NormalizationException(String message) {
078: super (message);
079: }
080:
081: /**
082: * Constructs a new runtime exception with the specified detail message and
083: * cause. <p>Note that the detail message associated with
084: * <code>cause</code> is <i>not</i> automatically incorporated in
085: * this runtime exception's detail message.
086: *
087: * @param message the detail message (which is saved for later retrieval
088: * by the {@link #getMessage()} method).
089: * @param cause the cause (which is saved for later retrieval by the
090: * {@link #getCause()} method). (A <tt>null</tt> value is
091: * permitted, and indicates that the cause is nonexistent or
092: * unknown.)
093: * @since 1.4
094: */
095: public NormalizationException(String message, Throwable cause) {
096: super (message, cause);
097: }
098:
099: /**
100: * Constructs a new runtime exception with the specified cause and a
101: * detail message of <tt>(cause==null ? null : cause.toString())</tt>
102: * (which typically contains the class and detail message of
103: * <tt>cause</tt>). This constructor is useful for runtime exceptions
104: * that are little more than wrappers for other throwables.
105: *
106: * @param cause the cause (which is saved for later retrieval by the
107: * {@link #getCause()} method). (A <tt>null</tt> value is
108: * permitted, and indicates that the cause is nonexistent or
109: * unknown.)
110: * @since 1.4
111: */
112: public NormalizationException(Throwable cause) {
113: super (cause);
114: }
115:
116: public NormalizationException(String message, String errorCode,
117: Object[] errorInfo) {
118: super (message);
119: this .errorCode = errorCode;
120: this .errorInfo = errorInfo;
121: }
122:
123: public String getErrorCode() {
124: return errorCode;
125: }
126:
127: public void setErrorCode(String errorCode) {
128: this .errorCode = errorCode;
129: }
130:
131: public Object[] getErrorInfo() {
132: return errorInfo;
133: }
134:
135: public void setErrorInfo(Object[] errorInfo) {
136: this.errorInfo = errorInfo;
137: }
138:
139: }
|