Java Doc for SException.java in  » Database-ORM » SimpleORM » simpleorm » core » 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 » Database ORM » SimpleORM » simpleorm.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.Throwable
      java.lang.Exception
         java.lang.RuntimeException
            simpleorm.core.SException

SException
abstract public class SException extends RuntimeException (Code)
Poor man's exception chaining. Used to both convert exceptions to RuntimeExceptions and to throw real exceptions. The print routines are careful to only print the inner (ie most complete) stack trace.

SimpleORM takes care to trap most error conditions and throw meaningful exception messages. Unlike most other Java code, they always include information about which objects were being processed at the time, eg. the primary key of the current record. We strongly encourage this practice as it greatly facilitates maintenance and debugging.

Subclasses are actually thrown, namely SException.Error to indicate probable bugs in the user's program, SException.InternalError to indicate bugs in SimpleOrm, SException.JDBC for chained JDBC errors, SException.Data for errors that probably the result of run-time data problems. SException.Test is used to indicate failed test cases.

Other well defined exceptions that a user may want to trap are given explicit subclasses (eg. SRecordInstance.BrokenOptimisticLockException).

SimpleORM only throws SExceptions which extend RuntimeException and so avoid the need to clutter the code with unnecessary try/catch blocks. The only reason to use try/catch when using SimpleORM is because you really want to catch an error.

(The author stongly disagrees with the way that Java forces one to declare and catch exceptions because it encourages mediocre programmers to hide exceptions which is a very nasty practice. (Even Sun programmers do this quite regularly in the Java libraries, eg. System.out.println()!) It also clutters the code for no good reason. IMHO Java's "checked" exceptions add no value whatsoever in practice.)


Inner Class :public static class Error extends SException
Inner Class :public static class InternalError extends SException
Inner Class :public static class JDBC extends SException
Inner Class :public static class Data extends SException
Inner Class :public static class Test extends SException


Constructor Summary
public  SException(String message, Throwable nestedException)
     A nested exception.
public  SException(String message)
    
public  SException(Throwable nestedException)
    
public  SException()
     Avoid using this one, include message.

Method Summary
public  voidprintStackTrace(PrintWriter printer)
     Prints all the exception messages and then just prints the inner stack trace which is usually the relevant one.
public  voidprintStackTrace(PrintStream printer)
    
public  voidprintStackTrace()
    
public  StringtoString()
     Contains both the message and the nestedException message.


Constructor Detail
SException
public SException(String message, Throwable nestedException)(Code)
A nested exception. Stack trace will include both message and as well as any message in nestedException.



SException
public SException(String message)(Code)



SException
public SException(Throwable nestedException)(Code)



SException
public SException()(Code)
Avoid using this one, include message.




Method Detail
printStackTrace
public void printStackTrace(PrintWriter printer)(Code)
Prints all the exception messages and then just prints the inner stack trace which is usually the relevant one. These are normmaly only called by the System for uncaught errors.



printStackTrace
public void printStackTrace(PrintStream printer)(Code)



printStackTrace
public void printStackTrace()(Code)



toString
public String toString()(Code)
Contains both the message and the nestedException message.





Methods inherited from java.lang.Throwable
native public synchronized Throwable fillInStackTrace()(Code)(Java Doc)
public Throwable getCause()(Code)(Java Doc)
public String getLocalizedMessage()(Code)(Java Doc)
public String getMessage()(Code)(Java Doc)
public StackTraceElement[] getStackTrace()(Code)(Java Doc)
public synchronized Throwable initCause(Throwable cause)(Code)(Java Doc)
public void printStackTrace()(Code)(Java Doc)
public void printStackTrace(PrintStream s)(Code)(Java Doc)
public void printStackTrace(PrintWriter s)(Code)(Java Doc)
public void setStackTrace(StackTraceElement[] stackTrace)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.