View Javadoc

1   /*
2    * Copyright 2004-2005 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5    * use this file except in compliance with the License. You may obtain a copy of
6    * the License at
7    * 
8    * http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations under
14   * the License.
15   */
16  package net.sf.composite.validate;
17  
18  import net.sf.composite.CompositeException;
19  import net.sf.composite.util.ObjectUtils;
20  
21  /***
22   * Indicates that a composite could not be validated for some reason.
23   * 
24   * @author Matt Sgarlata
25   * @since Mar 11, 2005
26   */
27  public class ComponentValidationException extends CompositeException {
28  
29  	public ComponentValidationException() {
30  		super();
31  	}
32  	public ComponentValidationException(String message) {
33  		super(message);
34  	}
35  	public ComponentValidationException(String message, Throwable cause) {
36  		super(message, cause);
37  	}
38  	public ComponentValidationException(Throwable cause) {
39  		super(cause);
40  	}
41  	
42  	public ComponentValidationException(Object composite, String reason) {
43  		super("The composite " + ObjectUtils.getObjectDescription(composite) + " is invalid because " + reason);
44  	}
45  }