fr.paris.lutece.plugins.rest.util.json
Class JSONUtil

java.lang.Object
  extended by fr.paris.lutece.plugins.rest.util.json.JSONUtil

public final class JSONUtil
extends Object

JSON Utils


Method Summary
static String formatError(String strMessage, int nCode)
          Format error as JSON
static net.sf.json.JSONObject json(Map model)
          Convert a model into a JSON object
static String model2Json(Map model)
          Convert a model into a JSON formatted string
static String model2Xml(Map model)
          Convert a model into an XML generated string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

model2Json

public static String model2Json(Map model)
Convert a model into a JSON formatted string

Parameters:
model - The model
Returns:
The JSON string

model2Xml

public static String model2Xml(Map model)
Convert a model into an XML generated string

Parameters:
model - The model
Returns:
The XML string

json

public static net.sf.json.JSONObject json(Map model)
Convert a model into a JSON object

Parameters:
model - The model
Returns:
The JSON Object

formatError

public static String formatError(String strMessage,
                                 int nCode)
Format error as JSON

Parameters:
strMessage - the error message
nCode - The error code
Returns:
The formatted string


Copyright © 2013 Mairie de Paris. All Rights Reserved.