Source Code Cross Referenced for ConfigurationException.java in  » Inversion-of-Control » DNA » org » codehaus » dna » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Inversion of Control » DNA » org.codehaus.dna 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) The DNA Group. All rights reserved.
003:         *
004:         * This software is published under the terms of the DNA
005:         * Software License version 1.1, a copy of which has been included
006:         * with this distribution in the LICENSE.txt file.
007:         */
008:        package org.codehaus.dna;
009:
010:        /**
011:         * The ConfigurationException is used to signal a problem
012:         * with the configuration object. The configuration object
013:         * may have malformed data (ie expected an integer but got
014:         * a string), have missing data (ie no attribute with specified
015:         * name) or may fail to be valid via some other mechanism.
016:         *
017:         * @version $Revision: 1.2 $ $Date: 2004/05/01 09:51:48 $
018:         */
019:        public class ConfigurationException extends Exception {
020:            /**
021:             * The exception that caused this exception if any.
022:             */
023:            private final Throwable m_cause;
024:
025:            /**
026:             * The xpath to the configuration element that
027:             * caused the exception. This may be null or empty
028:             * if not relevent or not known.
029:             */
030:            private final String m_path;
031:
032:            /**
033:             * A string describing the location of the configuration
034:             * element that caused the exception. This may be null
035:             * or empty if not relevent or not known. The location is
036:             * usally formatted according to <tt>uri[:line number[:column number]]</tt>.
037:             * Note that the line and column numbers may not be present.
038:             */
039:            private final String m_location;
040:
041:            /**
042:             * Create configuration exception with specified message,
043:             * path and location.
044:             *
045:             * @param message the message
046:             * @param path the path
047:             * @param location the location
048:             */
049:            public ConfigurationException(final String message,
050:                    final String path, final String location) {
051:                this (message, path, location, null);
052:            }
053:
054:            /**
055:             * Create configuration exception with specified
056:             * message and cause.
057:             *
058:             * @param message the message
059:             * @param cause the cause
060:             */
061:            public ConfigurationException(final String message,
062:                    final Throwable cause) {
063:                this (message, null, null, cause);
064:            }
065:
066:            /**
067:             * Create configuration exception with specified message,
068:             * path, location and cause.
069:             *
070:             * @param message the message
071:             * @param path the path
072:             * @param location the location
073:             * @param cause the cause
074:             */
075:            public ConfigurationException(final String message,
076:                    final String path, final String location,
077:                    final Throwable cause) {
078:                super (message);
079:                m_cause = cause;
080:                m_path = path;
081:                m_location = location;
082:            }
083:
084:            /**
085:             * The xpath to the configuration element that
086:             * caused the exception. This may be null or empty
087:             * if not relevent or not known.
088:             *
089:             * @return the xpath to element that caused exception
090:             */
091:            public String getPath() {
092:                return m_path;
093:            }
094:
095:            /**
096:             * Return a string describing the location of the configuration
097:             * element that caused the exception. This may be null
098:             * or empty if not relevent or not known. The location is usally
099:             * formatted according to <tt>uri[:line number[:column number]]</tt>.
100:             * Note that the line and column numbers may not be present.
101:             *
102:             * @return the location where exception occured
103:             */
104:            public String getLocation() {
105:                return m_location;
106:            }
107:
108:            /**
109:             * Return the exception that caused this exception if any.
110:             *
111:             * @return the exception that caused this exception if any.
112:             */
113:            public Throwable getCause() {
114:                return m_cause;
115:            }
116:
117:            /**
118:             * Return the string representation of exception.
119:             *
120:             * @return the string representation of exception.
121:             */
122:            public String toString() {
123:                final StringBuffer sb = new StringBuffer();
124:
125:                if (null != m_path && !"".equals(m_path)) {
126:                    sb.append(" - ");
127:                    sb.append(m_path);
128:                }
129:
130:                if (null != m_location && !"".equals(m_location)) {
131:                    sb.append(" @ ");
132:                    sb.append(m_location);
133:                }
134:
135:                if (0 != sb.length()) {
136:                    return super.toString() + sb;
137:                } else {
138:                    return super.toString();
139:                }
140:            }
141:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.