Show TOC

InputValueFormatException classLocate this document in the navigation structure

InputValueFormatException can be used as a convenient way to catch all the input value format issue in the state development, as shown below.

Package
com.sybase365.mobiliser.brand.plugins.exceptions
Syntax
Syntax
public class InputValueFormatException
Members

All members of InputValueFormatException, including inherited members.

Constructors
Modifier and Type Constructor Description
public InputValueFormatException(String)  
public InputValueFormatException(String, Throwable)  
public InputValueFormatException(Throwable)  
Usage
               try {
                       InputValue iValue;

                       iValue = inCustomerName.getInputValue();
                       if (iValue!=null) { 
                               String name = iValue.getString().trim();                
                               if (!validFullName(name)) {
                                       throw new InputValueFormatException("Invalid: " +
                                                               inCustomerName.getDescription());
                               }
                               customer.setDisplayName(name);
                       }

                       //
                       // Check the second attribute, etc..
                       //

               } catch (InputValueFormatException fex) {

                       //
                       // Catch all in one location
               //
                       log.error(fex.getMessage(), fex);
                       return continueDyn(-9);
               }