2012-01-03 2 views

Répondre

0

vous voulez juste pour le point de vue de développeur puis installez addons/extensions pour votre navigateur

ou si vous voulez vraiment embellir votre code puis essayez

http://jsbeautifier.org/

0

A cet effet, je me sers bibliothèque jackson-mapper-lgpl. DefaultPrettyPrinter peut vous aider.

Voici mon sérialiseur:

public class JSONSerializer 
{ 
    private ObjectMapper mapper; 

public JSONSerializer() { 
    this.mapper = new ObjectMapper(); 
} 

public String serialize(Object ob) throws IOException 
{ 
    if (ob == null) { 
     throw new NullPointerException("Cannot serialize null value"); 
    } 
    return mapper.defaultPrettyPrintingWriter().writeValueAsString(ob); 
} 
} 
Questions connexes