@SuppressWarnings("rawtypes") public void marshal(Object value, HierarchicalStreamWriter writer, MarshallingContext context) { AbstractMap map = (AbstractMap) value; for (Object obj : map.entrySet()) { Entry entry = (Entry) obj; writer.startNode(entry.getKey().toString()); if (entry.getValue() instanceof String) { writer.setValue(entry.getValue().toString()); } else if (entry.getValue() instanceof Map) { marshal(entry.getValue(), writer, context); } else { context.convertAnother(entry.getValue()); } writer.endNode(); } }
xstream.registerConverter(new GuiceBeanConverter(fmapper, injector)); xstream.registerConverter(new AtomAttributeConverter()); xstream.registerConverter(new ExtendableBeanConverter(), XStream.PRIORITY_VERY_HIGH); xstream.setMode(XStream.NO_REFERENCES);
xstream.registerConverter(new GuiceBeanConverter(fmapper, injector)); xstream.registerConverter(new AtomAttributeConverter()); xstream.registerConverter(new ExtendableBeanConverter(), XStream.PRIORITY_VERY_HIGH); xstream.setMode(XStream.NO_REFERENCES);
@SuppressWarnings("rawtypes") public void marshal(Object value, HierarchicalStreamWriter writer, MarshallingContext context) { AbstractMap map = (AbstractMap) value; for (Object obj : map.entrySet()) { Entry entry = (Entry) obj; writer.startNode(entry.getKey().toString()); if (entry.getValue() instanceof String) { writer.setValue(entry.getValue().toString()); } else if (entry.getValue() instanceof Map) { marshal(entry.getValue(), writer, context); } else { context.convertAnother(entry.getValue()); } writer.endNode(); } }
@SuppressWarnings("rawtypes") public void marshal(Object value, HierarchicalStreamWriter writer, MarshallingContext context) { AbstractMap map = (AbstractMap) value; for (Object obj : map.entrySet()) { Entry entry = (Entry) obj; writer.startNode(entry.getKey().toString()); if (entry.getValue() instanceof String) { writer.setValue(entry.getValue().toString()); } else if (entry.getValue() instanceof Map) { marshal(entry.getValue(), writer, context); } else { context.convertAnother(entry.getValue()); } writer.endNode(); } }