1 8 package org.codehaus.dna; 9 10 19 public class ConfigurationException 20 extends Exception 21 { 22 25 private final Throwable m_cause; 26 27 32 private final String m_path; 33 34 41 private final String m_location; 42 43 51 public ConfigurationException( final String message, 52 final String path, 53 final String location ) 54 { 55 this( message, path, location, null ); 56 } 57 58 65 public ConfigurationException( final String message, 66 final Throwable cause ) 67 { 68 this( message, null, null, cause ); 69 } 70 71 80 public ConfigurationException( final String message, 81 final String path, 82 final String location, 83 final Throwable cause ) 84 { 85 super( message ); 86 m_cause = cause; 87 m_path = path; 88 m_location = location; 89 } 90 91 98 public String getPath() 99 { 100 return m_path; 101 } 102 103 112 public String getLocation() 113 { 114 return m_location; 115 } 116 117 122 public Throwable getCause() 123 { 124 return m_cause; 125 } 126 127 132 public String toString() 133 { 134 final StringBuffer sb = new StringBuffer (); 135 136 if( null != m_path && !"".equals( m_path ) ) 137 { 138 sb.append( " - " ); 139 sb.append( m_path ); 140 } 141 142 if( null != m_location && !"".equals( m_location ) ) 143 { 144 sb.append( " @ " ); 145 sb.append( m_location ); 146 } 147 148 if( 0 != sb.length() ) 149 { 150 return super.toString() + sb; 151 } 152 else 153 { 154 return super.toString(); 155 } 156 } 157 } 158 | Popular Tags |