KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > facelets > tag > TagAttributeException


1 /**
2  * Licensed under the Common Development and Distribution License,
3  * you may not use this file except in compliance with the License.
4  * You may obtain a copy of the License at
5  *
6  * http://www.sun.com/cddl/
7  *
8  * Unless required by applicable law or agreed to in writing, software
9  * distributed under the License is distributed on an "AS IS" BASIS,
10  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11  * implied. See the License for the specific language governing
12  * permissions and limitations under the License.
13  */

14
15 package com.sun.facelets.tag;
16
17 import com.sun.facelets.FaceletException;
18
19 /**
20  * An Exception caused by a TagAttribute
21  *
22  * @author Jacob Hookom
23  * @version $Id: TagAttributeException.java,v 1.3 2005/08/24 04:38:48 jhook Exp $
24  */

25 public final class TagAttributeException extends FaceletException {
26
27     /**
28      *
29      */

30     private static final long serialVersionUID = 1L;
31
32     public TagAttributeException(TagAttribute attr) {
33         super(attr.toString());
34     }
35
36     public TagAttributeException(TagAttribute attr, String JavaDoc message) {
37         super(attr + " " + message);
38     }
39
40     public TagAttributeException(TagAttribute attr, Throwable JavaDoc cause) {
41         super(attr + " " + cause.getMessage(), cause);
42     }
43
44     public TagAttributeException(TagAttribute attr, String JavaDoc message,
45             Throwable JavaDoc cause) {
46         super(attr + " " + message, cause);
47     }
48
49     /**
50      *
51      */

52     public TagAttributeException(Tag tag, TagAttribute attr) {
53         super(print(tag, attr));
54     }
55
56     private final static String JavaDoc print(Tag tag, TagAttribute attr) {
57         return tag.getLocation() + " <" + tag.getQName() + " " + attr.getQName()
58                 + "=\"" + attr.getValue() + "\">";
59     }
60
61     /**
62      * @param message
63      */

64     public TagAttributeException(Tag tag, TagAttribute attr, String JavaDoc message) {
65         super(print(tag, attr) + " " + message);
66     }
67
68     /**
69      * @param cause
70      */

71     public TagAttributeException(Tag tag, TagAttribute attr, Throwable JavaDoc cause) {
72         super(print(tag, attr) + " " + cause.getMessage(), cause);
73     }
74
75     /**
76      * @param message
77      * @param cause
78      */

79     public TagAttributeException(Tag tag, TagAttribute attr, String JavaDoc message,
80             Throwable JavaDoc cause) {
81         super(print(tag, attr) + " " + message, cause);
82     }
83
84 }
85
Popular Tags