DDMFormLayoutJSONDeserializer implements DDMFormLayoutDeserializer { @Override public DDMFormLayoutDeserializerDeserializeResponse deserialize( DDMFormLayoutDeserializerDeserializeRequest ddmFormLayoutDeserializerDeserializeRequest) { DDMFormLayout ddmFormLayout = new DDMFormLayout(); DDMFormLayoutDeserializerDeserializeResponse.Builder builder = DDMFormLayoutDeserializerDeserializeResponse.Builder.newBuilder( ddmFormLayout); try { JSONObject jsonObject = _jsonFactory.createJSONObject( ddmFormLayoutDeserializerDeserializeRequest.getContent()); if (Validator.isNotNull( jsonObject.getString("definitionSchemaVersion"))) { ddmFormLayout.setDefinitionSchemaVersion( jsonObject.getString("definitionSchemaVersion")); } setDDMFormLayoutDefaultLocale( jsonObject.getString("defaultLanguageId"), ddmFormLayout); setDDMFormLayoutPages( jsonObject.getJSONArray("pages"), ddmFormLayout); setDDMFormLayoutPageTitlesDefaultLocale(ddmFormLayout); String paginationMode = jsonObject.getString("paginationMode"); if (Validator.isNotNull(paginationMode)) { setDDMFormLayoutPaginationMode(paginationMode, ddmFormLayout); } else { setDDMFormLayoutPaginationMode( DDMFormLayout.WIZARD_MODE, ddmFormLayout); } setDDMFormRules(jsonObject.getJSONArray("rules"), ddmFormLayout); return builder.build(); } catch (JSONException jsonException) { if (_log.isWarnEnabled()) { _log.warn(jsonException, jsonException); } builder = builder.exception(jsonException); } return builder.build(); }  @Override DDMFormLayoutDeserializerDeserializeResponse deserialize(
		DDMFormLayoutDeserializerDeserializeRequest
			ddmFormLayoutDeserializerDeserializeRequest);  }
@Test public void testDDMFormLayoutDeserializationWithSchemaVersion() throws Exception { DDMFormLayout ddmFormLayout = deserialize( read( "ddm-form-layout-json-deserializer-with-definition-schema-" + "version.json")); Assert.assertEquals("2.0", ddmFormLayout.getDefinitionSchemaVersion()); }