final NewMethod newMethod = method.copy(serializationFactory);
newMethod.setAbstract(false);
newMethod.setFinal(true);
newMethod.setNative(true);
final SwitchTemplatedFile body = new SwitchTemplatedFile();
final Iterator<Map.Entry<Type, Type>> iterator = objectReaders.entrySet().iterator();
while (iterator.hasNext()) {
final Map.Entry<Type, Type> entry = iterator.next();
final Type type = entry.getKey();
if (false == this.isSerializable(type)) {
continue;
}
final Type objectReader = entry.getValue();
final Field objectReaderSingleton = objectReader.getField(SerializationConstants.SINGLETON);
body.register(type, objectReaderSingleton);
context.debug(type.getName() + " = " + objectReader.getName());
}
newMethod.setBody(body);