private Number setFeatureField ( SimpleFeature pipe , String key ) { Number field = ( ( Number ) pipe . getAttribute ( key ) ) ; if ( field == null ) { pm . errorMessage ( msg . message ( "trentoP.error.number" ) + key ) ; throw new IllegalArgumentException ( msg . message ( "trentoP.error.number" ) + key ) ; } // return the Number return field ; }
Check if there is the field in a SimpleFeature and if it s a Number .