Search in sources :

Example 1 with DefaultTypeNameExtractor

use of br.com.caelum.vraptor.interceptor.DefaultTypeNameExtractor in project restfulie-java by caelum.

the class MyCollectionConverter method main.

public static void main(String[] args) {
    JSONSerializationCustomized ser = new JSONSerializationCustomized(null, new DefaultTypeNameExtractor(), null);
    XStream xstream = ser.getXStream();
    List l = new ArrayList();
    l.add(new Item("a", "b"));
    l.add(new Item("d", "c"));
    System.out.println(xstream.toXML(l));
    List l2 = (List) xstream.fromXML(xstream.toXML(l));
    System.out.println(l2);
}
Also used : DefaultTypeNameExtractor(br.com.caelum.vraptor.interceptor.DefaultTypeNameExtractor) XStream(com.thoughtworks.xstream.XStream) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

DefaultTypeNameExtractor (br.com.caelum.vraptor.interceptor.DefaultTypeNameExtractor)1 XStream (com.thoughtworks.xstream.XStream)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1