Class SException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SException.Data
,SException.Error
,SException.InternalError
,SException.Jdbc
,SException.Test
,SException.Validation
,SRecordInstance.BrokenOptimisticLockException
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.)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Errors in data or environment at runtime, not necessarily a programming bug.static class
Probable bug in user's program.static class
Probable bug in SimpleORM.static class
Chained JDBC Exception, could be anything as JDBC does not separate exceptions out and provides minimal information about their underlying causes.static class
Exception thrown due to failed unit test cases.static class
This Exception thrown by user written code to indicate user data entry errors, especially in the business rule methods. -
Constructor Summary
ConstructorsConstructorDescriptionAvoid using this one, include message.SException
(String message) SException
(String message, Throwable nestedException) SException
(Throwable nestedException) -
Method Summary
Modifier and TypeMethodDescriptionObject[]
setFieldMeta
(SFieldMeta fieldMeta) setFieldValue
(Object fieldValue) setInstance
(SRecordInstance instance) setRecordInstance
(SRecordInstance instance) setValidator
(Class<SValidatorI> validator) Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SException
-
SException
-
SException
-
SException
public SException()Avoid using this one, include message.
-
-
Method Details
-
getRecordInstance
-
setRecordInstance
-
getFieldMeta
-
setFieldMeta
-
getInstance
-
setInstance
-
getFieldValue
-
setFieldValue
-
getParams
-
setParams
-
getValidator
-
setValidator
-