@Test public void testNsesss2WrappedSpis() throws Exception { ObjectMapper om = new JacksonProvider().getContext(Spis.class); om.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true); Spis spis = NsesssUtils.defaultSpis(); String toJson = om.writeValueAsString(new DesObjectWrapper(spis)); DesObjectWrapper wrapper = om.readValue(toJson, DesObjectWrapper.class); assertNotNull(wrapper); Spis result = wrapper.getSpis(); assertNotNull(result); assertEquals("ERMS", result.getEvidencniUdaje().getEvidence().getNazevEvidenceDokumentu()); assertEquals(TZpusobVyrizeni.VYŘÍZENÍ_DOKUMENTEM, result.getEvidencniUdaje().getVyrizeniUzavreni().getZpusob()); assertEquals("Vyplývá ze spisového plánu organizace", result.getEvidencniUdaje().getVyrazovani().getSkartacniRezim().getOduvodneni()); assertEquals("Uzavření spisu", result.getEvidencniUdaje().getVyrazovani().getSkartacniRezim().getSpousteciUdalost()); assertEquals(TLogicky.ANO, result.getEvidencniUdaje().getManipulace().getAnalogovyDokument().ANO); }
@Override public ObjectMapper getContext(Class<?> type) { return mapper; }
JacksonProvider implements ContextResolver<ObjectMapper> { @Override public ObjectMapper getContext(Class<?> type) { return mapper; } }
JacksonProvider implements ContextResolver<ObjectMapper> { @Override public ObjectMapper getContext(Class<?> type) { return mapper; } JacksonProvider(); }
JacksonProvider implements ContextResolver<ObjectMapper> { @Override public ObjectMapper getContext(Class<?> type) { return mapper; } JacksonProvider(); @Override ObjectMapper getContext(Class<?> type); }
JacksonProvider implements ContextResolver<ObjectMapper> { @Override public ObjectMapper getContext(Class<?> type) { return mapper; } JacksonProvider(); @Override ObjectMapper getContext(Class<?> type);  }