public short getShort ( String path ) { //The type returned from Groovy depends on the input, so we need to handle different numerical types. Object value = get ( path ) ; if ( value instanceof Short ) { return ( Short ) value ; } else if ( value instanceof Long ) { return ( ( Long ) value ) . shortValue ( ) ; } else if ( value instanceof Integer ) { return ( ( Integer ) value ) . shortValue ( ) ; } else { return ObjectConverter . convertObjectTo ( value , Short . class ) ; } }
Get the result of an Object path expression as a short .