1 package org.apache.jcs.config;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 /***
23 * This class is based on the log4j class org.apache.log4j.config.PropertySetter
24 * that was made by Anders Kristensen
25 *
26 */
27
28 /***
29 * Thrown when an error is encountered whilst attempting to set a property using
30 * the {@link PropertySetter}utility class.
31 *
32 * @since 1.1
33 */
34 public class PropertySetterException
35 extends Exception
36 {
37 private static final long serialVersionUID = -210271658004609028L;
38
39 /*** Description of the Field */
40 protected Throwable rootCause;
41
42 /***
43 * Constructor for the PropertySetterException object
44 *
45 * @param msg
46 */
47 public PropertySetterException( String msg )
48 {
49 super( msg );
50 }
51
52 /***
53 * Constructor for the PropertySetterException object
54 *
55 * @param rootCause
56 */
57 public PropertySetterException( Throwable rootCause )
58 {
59 super();
60 this.rootCause = rootCause;
61 }
62
63 /***
64 * Returns descriptive text on the cause of this exception.
65 *
66 * @return The message value
67 */
68
69 public String getMessage()
70 {
71 String msg = super.getMessage();
72 if ( msg == null && rootCause != null )
73 {
74 msg = rootCause.getMessage();
75 }
76 return msg;
77 }
78 }