@ SuppressWarnings ( "unchecked" ) public T cloneObject ( String key ) { if ( this . objects . containsKey ( key ) ) { T object = this . objects . get ( key ) ; if ( object != null ) { try { return ( T ) object . clone ( ) ; } catch ( Exception ex ) { throw new RuntimeException ( ex ) ; } } return null ; } throw new RuntimeException ( "[cloning error] object by name <" + key + "> not registered in " + getClass ( ) . getSimpleName ( ) ) ; }
Creates a cloned object by executing the clone method on the registered object