Source:
public <T extends Serializable> T deserialize(Object source, Class<T> type) throws SerializationExeption { if (source == null) { return null; } ObjectMapper mapper = new ObjectMapper(); mapper.getDeserializationConfig().addMixInAnnotations(NGuid.class, JsonNGuidMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(Guid.class, JsonNGuidMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VdcActionParametersBase.class, JsonVdcActionParametersBaseMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(IVdcQueryable.class, JsonIVdcQueryableMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VM.class, JsonVmMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(ValueObjectMap.class, JsonValueObjectMapMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VdsStatic.class, JsonVdsStaticMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VDS.class, JsonVDSMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VmTemplate.class, JsonVmTemplateMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(AddVmFromTemplateParameters.class, JsonAddVmFromTemplateParametersMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(AddVmFromSnapshotParameters.class, JsonAddVmFromSnapshotParametersMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(MoveOrCopyParameters.class, JsonMoveOrCopyParametersMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(AddVmTemplateParameters.class, JsonAddVmTemplateParametersMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VmManagementParametersBase.class, JsonVmManagementParametersBaseMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VmBase.class, JsonVmBaseMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VmStatic.class, JsonVmStaticMixIn.class); mapper.getSerializationConfig().addMixInAnnotations(VmTemplate.class, JsonVmTemplateMixIn.class); mapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.enableDefaultTyping(); return readJsonString(source, type, mapper); }

Target:
public <T extends Serializable> T deserialize(Object source, Class<T> type) throws SerializationExeption { if (source == null) { return null; } ObjectMapper mapper = new ObjectMapper(); mapper.getDeserializationConfig().addMixInAnnotations(NGuid.class, JsonNGuidMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(Guid.class, JsonNGuidMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VdcActionParametersBase.class, JsonVdcActionParametersBaseMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(IVdcQueryable.class, JsonIVdcQueryableMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VM.class, JsonVmMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(ValueObjectMap.class, JsonValueObjectMapMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VdsStatic.class, JsonVdsStaticMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VDS.class, JsonVDSMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VmTemplate.class, JsonVmTemplateMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(AddVmFromTemplateParameters.class, JsonAddVmFromTemplateParametersMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(AddVmFromSnapshotParameters.class, JsonAddVmFromSnapshotParametersMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(MoveOrCopyParameters.class, JsonMoveOrCopyParametersMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(AddVmTemplateParameters.class, JsonAddVmTemplateParametersMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VmManagementParametersBase.class, JsonVmManagementParametersBaseMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VmBase.class, JsonVmBaseMixIn.class); mapper.getDeserializationConfig().addMixInAnnotations(VmStatic.class, JsonVmStaticMixIn.class); mapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.enableDefaultTyping(); return readJsonString(source, type, mapper); }