ColumnMapProcessor extends AbstractMarkLogicItemProcessor<Map<String, Object>> { public void setRootLocalName(String rootName) { this.rootLocalName = rootName; } ColumnMapProcessor(ColumnMapSerializer columnMapSerializer);  ColumnMapProcessor(ColumnMapSerializer columnMapSerializer, UriGenerator uriGenerator); @Override AbstractWriteHandle getContentHandle(Map<String, Object> item); void setRootLocalName(String rootName);  }
@Test public void columnMapSimpleXmlTest() throws Exception { ColumnMapProcessor columnMapProcessor = new ColumnMapProcessor(new DefaultStaxColumnMapSerializer()); columnMapProcessor.setRootLocalName("test"); Map<String, Object> map = new HashMap<String, Object>(); map.put("sample", "value"); DocumentWriteOperation handle = columnMapProcessor.process(map); logger.info(handle.getUri()); StringHandle strHandle = (StringHandle) handle.getContent(); logger.info(strHandle.get()); assertTrue("<test><sample>value</sample></test>".equals(strHandle.get())); assertNotNull(handle); }
@Test public void getRootNameFromMapTest() throws Exception { ColumnMapProcessor columnMapProcessor = new ColumnMapProcessor(new DefaultStaxColumnMapSerializer()); columnMapProcessor.setRootLocalName("type"); Map<String, Object> map = new HashMap<String, Object>(); map.put("type", "junk"); map.put("sample", "value"); DocumentWriteOperation handle = columnMapProcessor.process(map); logger.info(handle.getUri()); StringHandle strHandle = (StringHandle) handle.getContent(); logger.info(strHandle.get()); assertTrue("<junk><type>junk</type><sample>value</sample></junk>".equals(strHandle.get())); assertNotNull(handle); }