public static Short stringToShort ( String strString ) throws Exception { Number objData ; initGlobals ( ) ; // Make sure you have the utilities if ( ( strString == null ) || ( strString . equals ( Constant . BLANK ) ) ) return null ; strString = DataConverters . stripNonNumber ( strString ) ; try { synchronized ( gIntegerFormat ) { objData = gIntegerFormat . parse ( strString ) ; } if ( ! ( objData instanceof Short ) ) { if ( objData instanceof Number ) objData = new Short ( objData . shortValue ( ) ) ; else objData = null ; } } catch ( ParseException ex ) { objData = null ; } if ( objData == null ) { try { objData = new Short ( strString ) ; } catch ( NumberFormatException ex ) { throw ex ; } } return ( Short ) objData ; }
Convert this string to a Short .