public Template getTemplateByString ( String content , boolean cache ) { if ( ! cache ) { return buildTemplateBySource ( new StringSource ( content , cache ) ) ; } String cacheKey = HashKit . md5 ( content ) ; Template template = templateCache . get ( cacheKey ) ; if ( template == null ) { template = buildTemplateBySource ( new StringSource ( content , cache ) ) ; templateCache . put ( cacheKey , template ) ; } else if ( devMode ) { if ( template . isModified ( ) ) { template = buildTemplateBySource ( new StringSource ( content , cache ) ) ; templateCache . put ( cacheKey , template ) ; } } return template ; }
Get template by string content