@Nonnull
public JDefinedClass generateSerializer( @Nonnull DomainObjectDescriptor domainObjectDescriptor ) throws JClassAlreadyExistsException {
JClass domainType = codeGenerator.ref( domainObjectDescriptor.getQualifiedName() );
//the class
JDefinedClass serializerClass = codeModel._class( createSerializerClassName( domainType.fullName() ) )._extends( createSerializerExtendsExpression( domainType ) );
//the constructor
JMethod constructor = createConstructor( serializerClass, domainObjectDescriptor );
JMethod serializeMethod = createSerializeMethodStub( domainType, serializerClass );