public void setAsText ( final String text ) { if ( BeanUtils . isNull ( text ) ) { setValue ( null ) ; return ; } try { Object newValue = Short . decode ( text ) ; setValue ( newValue ) ; } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( "Failed to parse short." , e ) ; } }
Map the argument text into and Short using Short . decode .