public static StringTemplateGroup readStringTemplateGroup ( InputStream stream ) { try { return new StringTemplateGroup ( new InputStreamReader ( stream , "UTF-8" ) , DefaultTemplateLexer . class , new StringTemplateErrorListener ( ) { @ SuppressWarnings ( "synthetic-access" ) public void error ( String arg0 , Throwable arg1 ) { LOG . error ( arg0 + ": " + arg1 . getMessage ( ) , arg1 ) ; } @ SuppressWarnings ( "synthetic-access" ) public void warning ( String arg0 ) { LOG . warn ( arg0 ) ; } } ) ; } catch ( Exception e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; return new StringTemplateGroup ( "dummy" ) ; } }
Reads a stringtemplate group from a stream .