private List < String > transformSimpleSequenceAsStringList ( SimpleSequence sequence , String paramName ) throws TemplateModelException { List < String > list = new ArrayList <> ( ) ; int size = sequence . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { TemplateModel model = sequence . get ( i ) ; if ( ! ( model instanceof SimpleScalar ) ) { throw new IllegalArgumentException ( paramName + "'s item must be string" ) ; } list . add ( ( ( SimpleScalar ) model ) . getAsString ( ) ) ; } return list ; }
Transform simple sequence as string list .