@ SuppressWarnings ( "unchecked" ) public T create ( Map < String , Object > data ) { Object [ ] args = new Object [ arguments . length ] ; for ( int i = 0 , n = args . length ; i < n ; i ++ ) { args [ i ] = arguments [ i ] . getValue ( data ) ; } try { return ( T ) raw . newInstance ( args ) ; } catch ( IllegalArgumentException e ) { throw new SerializationException ( "Unable to create; " + e . getMessage ( ) , e ) ; } catch ( InstantiationException e ) { throw new SerializationException ( "Unable to create; " + e . getMessage ( ) , e ) ; } catch ( IllegalAccessException e ) { throw new SerializationException ( "Unable to create; " + e . getMessage ( ) , e ) ; } catch ( InvocationTargetException e ) { throw new SerializationException ( "Unable to create; " + e . getCause ( ) . getMessage ( ) , e . getCause ( ) ) ; } }
Create a new instance using the given deserialized data . The data is only used if this factory has any serialized fields .