|
|
Creating user-defined exceptions is a way of distinguishing exceptions thrown by your own services. It is optional because you can rely on the built-in java.lang.Exception object to be thrown from your methods. The bank component created in this section uses two user-defined exceptions:
• CustomerException is located in the com.adobe.livecycle.sample.customer package.
• AccountException is located in the com.adobe.livecycle.sample.account package.The following Java code creates the CustomerException.Example: Creating CustomerExceptionpackage com.adobe.livecycle.sample.customer;/*** CustomerException throws Customer service specific exceptions.**/public class CustomerException extends Exception {//Constructorpublic CustomerException() {super();}public CustomerException(String message){super(message);}}The following Java code creates the AccountException.Example: Creating AccountExceptionpackage com.adobe.livecycle.sample.account;/*** AccountException throws Account service specific exceptions.**/public class AccountException extends Exception {//Constructorpublic AccountException() {super();}public AccountException(String message){super(message);}}
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/componentCreatingMultiple.159.9.html