private ConfigCommand createConfigCommand ( final Sheet sheet , final Cell firstCell , final int sheetRightCol , final String commandName , final Map < String , String > attrMap ) { @ SuppressWarnings ( "rawtypes" ) Class clas = commandMap . get ( commandName ) ; if ( clas == null ) { LOG . log ( Level . WARNING , "Cannot find command class for {} " , commandName ) ; return null ; } try { ConfigCommand command = ( ConfigCommand ) clas . newInstance ( ) ; command . setCommandTypeName ( commandName ) ; for ( Map . Entry < String , String > attr : attrMap . entrySet ( ) ) { WebSheetUtility . setObjectProperty ( command , attr . getKey ( ) , attr . getValue ( ) , true ) ; } command . getConfigRange ( ) . setFirstRowRef ( firstCell , true ) ; command . getConfigRange ( ) . setLastRowPlusRef ( sheet , sheetRightCol , command . getLastRow ( ) , true ) ; return command ; } catch ( Exception e ) { LOG . log ( Level . WARNING , "Failed to initialize command class " + clas . getName ( ) + " for command" + commandName , e ) ; return null ; } }
create configuration command .