public static Encoder lookupEncoder ( GrailsApplication grailsApplication , String codecName ) { ApplicationContext ctx = grailsApplication != null ? grailsApplication . getMainContext ( ) : null ; if ( ctx != null ) { try { CodecLookup codecLookup = ctx . getBean ( "codecLookup" , CodecLookup . class ) ; return codecLookup . lookupEncoder ( codecName ) ; } catch ( NoSuchBeanDefinitionException e ) { // ignore missing codecLookup bean in tests log . debug ( "codecLookup bean is missing from test context." , e ) ; } } return null ; }
Lookup encoder .