EncodingStateRegistry registry=new DefaultEncodingStateRegistry();
private Encoder getEncoder(GrailsApplication grailsApplication, Class<?> codecClass) {
Encoder encoder=null;
if (grailsApplication != null && codecClass != null) {
GrailsCodecClass codecArtefact = (GrailsCodecClass) grailsApplication.getArtefact("Codec", codecClass.getName());
encoder = codecArtefact.getEncoder();
}
return encoder;
}