Source Code Cross Referenced for AnalysisError.java in  » Code-Analyzer » findbugs » edu » umd » cs » findbugs » 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 » Code Analyzer » findbugs » edu.umd.cs.findbugs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package edu.umd.cs.findbugs;
002:
003:        import java.util.ArrayList;
004:
005:        /**
006:         * Object recording a recoverable error that occurred during analysis.
007:         *
008:         * @author David Hovemeyer
009:         */
010:        public class AnalysisError {
011:            private String message;
012:            private String exceptionMessage;
013:            private String[] stackTrace;
014:            private String nestedExceptionMessage;
015:            private String[] nestedStackTrace;
016:            private final Throwable exception;
017:
018:            /**
019:             * Constructor.
020:             *
021:             * @param message message describing the error
022:             */
023:            public AnalysisError(String message) {
024:                this (message, null);
025:            }
026:
027:            /**
028:             * Constructor.
029:             *
030:             * @param message   message describing the error
031:             * @param exception exception which is the cause of the error
032:             */
033:            public AnalysisError(String message, Throwable exception) {
034:                this .message = message;
035:                this .exception = exception;
036:                if (exception != null) {
037:                    exceptionMessage = exception.toString();
038:                    stackTrace = getStackTraceAsStringArray(exception);
039:                    Throwable initCause = exception.getCause();
040:                    if (initCause != null) {
041:                        nestedExceptionMessage = initCause.toString();
042:                        nestedStackTrace = getStackTraceAsStringArray(initCause);
043:                    }
044:
045:                }
046:            }
047:
048:            /**
049:             * @param exception
050:             * @return
051:             */
052:            private String[] getStackTraceAsStringArray(Throwable exception) {
053:                StackTraceElement[] exceptionStackTrace = exception
054:                        .getStackTrace();
055:                ArrayList<String> arr = new ArrayList<String>();
056:                for (StackTraceElement aExceptionStackTrace : exceptionStackTrace) {
057:                    arr.add(aExceptionStackTrace.toString());
058:                }
059:                String[] tmp = arr.toArray(new String[arr.size()]);
060:                return tmp;
061:            }
062:
063:            /**
064:             * Set the message describing the error.
065:             *
066:             * @param message message describing the error
067:             */
068:            public void setMessage(String message) {
069:                this .message = message;
070:            }
071:
072:            /**
073:             * Get the message describing the error.
074:             */
075:            public String getMessage() {
076:                return message;
077:            }
078:
079:            /**
080:             * Set the exception message.  This is the value returned by
081:             * calling toString() on the original exception object.
082:             *
083:             * @param exceptionMessage the exception message
084:             */
085:            public void setExceptionMessage(String exceptionMessage) {
086:                this .exceptionMessage = exceptionMessage;
087:            }
088:
089:            /**
090:             * Get the exception message.  This is the value returned by
091:             * calling toString() on the original exception object.
092:             */
093:            public String getExceptionMessage() {
094:                return exceptionMessage;
095:            }
096:
097:            /**
098:             * Get the exception message.  This is the value returned by
099:             * calling toString() on the original exception object.
100:             */
101:            public String getNestedExceptionMessage() {
102:                return nestedExceptionMessage;
103:            }
104:
105:            /**
106:             * Set the stack trace elements.
107:             * These are the strings returned by calling toString()
108:             * on each StackTraceElement in the original exception.
109:             *
110:             * @param stackTraceList the stack trace elements
111:             */
112:            public void setStackTrace(String[] stackTraceList) {
113:                stackTrace = stackTraceList;
114:            }
115:
116:            /**
117:             * Get the stack trace elements.
118:             * These are the strings returned by calling toString()
119:             * on each StackTraceElement in the original exception.
120:             */
121:            public String[] getStackTrace() {
122:                return stackTrace;
123:            }
124:
125:            /**
126:             * Get the stack trace elements.
127:             * These are the strings returned by calling toString()
128:             * on each StackTraceElement in the original exception.
129:             */
130:            public String[] getNestedStackTrace() {
131:                return nestedStackTrace;
132:            }
133:
134:            /**
135:             * @return original exception object, or null if no exception was thrown
136:             */
137:            public Throwable getException() {
138:                return exception;
139:            }
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.