@ Deprecated protected static SoyData createFromExistingData ( Object obj ) { if ( obj instanceof SoyData ) { return ( SoyData ) obj ; } else if ( obj instanceof Map < ? , ? > ) { @ SuppressWarnings ( "unchecked" ) Map < String , ? > objCast = ( Map < String , ? > ) obj ; return new SoyMapData ( objCast ) ; } else if ( obj instanceof Iterable < ? > ) { return new SoyListData ( ( Iterable < ? > ) obj ) ; } else if ( obj instanceof Future < ? > ) { // Note: In the old SoyData, we don't support late-resolution of Futures. We immediately // resolve the Future object here. For late-resolution, use SoyValueConverter.convert(). try { return createFromExistingData ( ( ( Future < ? > ) obj ) . get ( ) ) ; } catch ( InterruptedException e ) { throw new SoyDataException ( "Encountered InterruptedException when resolving Future object." , e ) ; } catch ( ExecutionException e ) { throw new SoyDataException ( "Encountered ExecutionException when resolving Future object." , e ) ; } } else { SoyValue soyValue = SoyValueConverter . INSTANCE . convert ( obj ) . resolve ( ) ; if ( soyValue instanceof SoyData ) { return ( SoyData ) soyValue ; } throw new SoyDataException ( "Attempting to convert unrecognized object to Soy data (object type " + obj . getClass ( ) . getName ( ) + ")." ) ; } }
Creates deprecated SoyData objects from standard Java data structures .