KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > apps > rasterizer > SVGConverterException


1 /*
2
3    Copyright 2001 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.apps.rasterizer;
19
20 /**
21  * Describes an error condition in <tt>SVGConverter</tt>
22  *
23  * @author <a HREF="mailto:vincent.hardy@sun.com">Vincent Hardy</a>
24  * @version $Id: SVGConverterException.java,v 1.4 2005/03/27 08:58:29 cam Exp $
25  */

26 public class SVGConverterException extends Exception JavaDoc {
27     /**
28      * Error code
29      */

30     protected String JavaDoc errorCode;
31
32     /**
33      * Additional information about the error condition
34      */

35     protected Object JavaDoc[] errorInfo;
36
37     /**
38      * Defines whether or not this is a fatal error condition
39      */

40     protected boolean isFatal;
41
42     public SVGConverterException(String JavaDoc errorCode){
43         this(errorCode, null, false);
44     }
45
46     public SVGConverterException(String JavaDoc errorCode,
47                                   Object JavaDoc[] errorInfo){
48         this(errorCode, errorInfo, false);
49     }
50
51     public SVGConverterException(String JavaDoc errorCode,
52                                   Object JavaDoc[] errorInfo,
53                                   boolean isFatal){
54         this.errorCode = errorCode;
55         this.errorInfo = errorInfo;
56         this.isFatal = isFatal;
57     }
58
59     public SVGConverterException(String JavaDoc errorCode,
60                                   boolean isFatal){
61         this(errorCode, null, isFatal);
62     }
63
64     public boolean isFatal(){
65         return isFatal;
66     }
67
68     public String JavaDoc getMessage(){
69         return Messages.formatMessage(errorCode, errorInfo);
70     }
71
72     public String JavaDoc getErrorCode(){
73         return errorCode;
74     }
75 }
76
Popular Tags